$npx -y skills add DevExpress/agent-skills --skill devexpress-wpf-data-gridBuild WPF applications with the DevExpress Data Grid (GridControl) — a data-aware control that displays and edits data in table, card, and treelist layouts. Use when adding GridControl to a WPF project, binding to data sources (Entity Framework Core, XPO, local collections, IColl
| 1 | # DevExpress WPF Data Grid (GridControl) |
| 2 | |
| 3 | The DevExpress WPF Data Grid is a data-aware control for displaying and editing data in tabular, card, and tree-style layouts. The primary class is `DevExpress.Xpf.Grid.GridControl`, which uses a pluggable **View** (`TableView`, `CardView`, or `TreeListView`) to render data and supports large datasets through server-mode and virtual sources. The grid handles sorting, filtering, grouping, summaries, master-detail data, conditional formatting, CRUD operations, and printing/exporting out of the box. |
| 4 | |
| 5 | ## When to Use This Skill |
| 6 | |
| 7 | Use this skill when you need to: |
| 8 | |
| 9 | - Add a `GridControl` to a WPF project and bind it to a data source |
| 10 | - Bind to Entity Framework Core, XPO, local collections, `ICollectionView`, OData, or LINQ to SQL |
| 11 | - Display large datasets with server mode or instant feedback mode (`EntityServerModeSource`, `EntityInstantFeedbackSource`) |
| 12 | - Configure columns explicitly with `GridColumn` and `FieldName` |
| 13 | - Replace the default in-place editor with a `ComboBoxEdit`, `DateEdit`, `CheckEdit`, or any `BaseEdit` descendant |
| 14 | - Enable sorting, filtering, grouping, and total/group summaries |
| 15 | - Implement CRUD operations against a database |
| 16 | - Display master-detail data (nested grids, custom templates, or tabbed details) |
| 17 | - Apply conditional formatting (color scales, data bars, icon sets, comparison rules) |
| 18 | - Print or export grid data to XLSX, CSV, PDF, or HTML |
| 19 | - Use the DevExpress Items Source Wizard at design time to scaffold binding code |
| 20 | - Migrate a `DataGrid` (standard WPF) to `GridControl` |
| 21 | |
| 22 | ## Prerequisites & Installation |
| 23 | |
| 24 | ### NuGet Packages |
| 25 | |
| 26 | | Package | Purpose | |
| 27 | |---------|---------| |
| 28 | | `DevExpress.Wpf.Grid` | Designer-mode install — installs the full grid package and adds toolbox items | |
| 29 | | `DevExpress.Wpf.Grid.Core` | Code-first install — minimal runtime assemblies for `GridControl`, `GridColumn`, views | |
| 30 | | `DevExpress.Wpf.Printing` | Required for `View.PrintPreview()`, `View.PrintDialog()`, and report-based export | |
| 31 | |
| 32 | ### .NET 8+ |
| 33 | |
| 34 | ```bash |
| 35 | dotnet add package DevExpress.Wpf.Grid.Core |
| 36 | ``` |
| 37 | |
| 38 | Add `<TargetFramework>net8.0-windows</TargetFramework>` and `<UseWPF>true</UseWPF>` to your `.csproj`. The Data Grid is Windows-only. |
| 39 | |
| 40 | ### .NET Framework (4.6.2+) |
| 41 | |
| 42 | See [references/getting-started-dotnet-fw.md](references/getting-started-dotnet-fw.md) for the .NET Framework setup, including the list of required assemblies if you reference them directly instead of via NuGet. |
| 43 | |
| 44 | **Important**: All DevExpress packages in a project must share the same version. A valid DevExpress license is required. |
| 45 | |
| 46 | ## Before You Start — Ask the Developer |
| 47 | |
| 48 | If the host agent has a structured question-asking tool available, use it to ask these questions one at a time with clear options — for example, Claude Code's `AskUserQuestion` tool or GitHub Copilot's `askQuestions` tool. If no such tool is available, ask the questions directly in the chat response before generating code. |
| 49 | |
| 50 | Before generating code, ask these questions to avoid rework: |
| 51 | |
| 52 | ### General Questions |
| 53 | 1. **Target framework**: .NET 8+ or .NET Framework 4.x? |
| 54 | 2. **New or existing project**: Creating a new WPF app, or adding `GridControl` to an existing one? |
| 55 | 3. **DevExpress version**: Which version are you targeting (e.g., 24.2, 25.1, 26.1)? All DX packages must use the same version. |
| 56 | |
| 57 | ### WPF and Setup |
| 58 | 4. **Designer or code**: Do you prefer the Visual Studio designer (toolbox + Items Source Wizard) or a code-only / MVVM approach? Designer-based setup is faster for prototypes; code-first is preferred for MVVM apps. |
| 59 | |
| 60 | ### Data Grid–Specific |
| 61 | 5. **Data source**: What is your data source? |
| 62 | - Local collection (`List<T>`, `ObservableCollection<T>`, `DataTable`) |
| 63 | - Entity Framework Core (`DbSet<T>` / `Local`) |
| 64 | - XPO (`XPCollection`, `XPInstantFeedbackSource`) |
| 65 | - Server mode (`EntityServerModeSource`, `LinqServerModeSource`) — req |