$npx -y skills add DevExpress/agent-skills --skill devexpress-winforms-data-gridDevExpress WinForms Data Grid — GridControl with GridView, BandedGridView, AdvBandedGridView, CardView, LayoutView, TileView, and WinExplorerView, plus the TreeList for hierarchical data. Covers data binding (regular, ServerMode, InstantFeedback, VirtualServerModeSource), column
| 1 | # DevExpress WinForms Data Grid, Tree List, and CardView |
| 2 | |
| 3 | DevExpress WinForms Data Grid (`DevExpress.XtraGrid.GridControl`) is a high-performance, DirectX-accelerated data-aware container that uses a flexible View-based architecture. A single `GridControl` hosts one or more views — `GridView` (tabular), `BandedGridView`, `AdvBandedGridView`, `CardView`, `LayoutView`, `TileView`, `WinExplorerView` — each presenting the same underlying data differently. The `TreeList` control (`DevExpress.XtraTreeList.TreeList`) is a separate but conceptually similar control for hierarchical data with parent-child relationships. |
| 4 | |
| 5 | Many concepts are shared across `GridView`, `BandedGridView`, `CardView`, `LayoutView`, and `TreeList`: data binding, column/field definition, in-place editors, conditional formatting, validation, filtering, sorting, focus/selection, drag-and-drop, and layout persistence. Some concepts are unique: master-detail belongs to `GridControl`, hierarchical node manipulation belongs to `TreeList`, and card-specific layout settings belong to `CardView`/`LayoutView`. This skill covers all three controls in one place because developers rarely use them in isolation. |
| 6 | |
| 7 | ## When to Use This Skill |
| 8 | |
| 9 | - Bind a grid or tree list to any data source (DataTable, BindingSource, IList, Entity Framework, XPO, LINQ to SQL, MongoDB, JSON, ServerMode/InstantFeedback sources, `VirtualServerModeSource` for infinite scrolling). |
| 10 | - Define columns at design time (Grid Designer), via auto-generation (`AutoPopulateColumns`), or in code (`PopulateColumns`, `Columns.AddVisible`). Configure unbound columns with `UnboundExpression` or `CustomUnboundColumnData`. |
| 11 | - Assign in-place editors with `RepositoryItem` descendants (`RepositoryItemSpinEdit`, `RepositoryItemLookUpEdit`, `RepositoryItemCheckEdit`, `RepositoryItemProgressBar`, `RepositoryItemRichTextEdit`, etc.). Use `CustomRowCellEdit` and `CustomRowCellEditForEditing` for per-cell editors. |
| 12 | - Format cell values (`DisplayFormat`, `EditFormat`, `CustomColumnDisplayText`) and switch between in-place edit, edit-form, and edit-entire-row modes. |
| 13 | - Apply conditional formatting (color scales, data bars, icon sets, expressions) via `FormatRules`. |
| 14 | - Validate cell or row input with `ValidatingEditor`, `ValidateRow`, `InvalidValueException`, `SetColumnError`, or `IDXDataErrorInfo`. |
| 15 | - Configure UI filtering (Excel-style filters, Auto Filter Row, Filter Editor, Find Panel) and apply filters in code (`ActiveFilterString`, `ActiveFilterCriteria`, `CustomRowFilter`, `SubstituteFilter`). |
| 16 | - Implement sorting and grouping, including custom comparisons (`CustomColumnSort`, `CustomColumnGroup`), grouping by display text, and grouping by date intervals. |
| 17 | - Build master-detail layouts with multiple nesting levels, hide detail relations conditionally, and access clone views. |
| 18 | - Print and export data (data-aware export to XLS/XLSX/CSV, WYSIWYG export to PDF/HTML/RTF, customize exported cells via `XlsxExportOptionsEx.CustomizeCell`). |
| 19 | - Configure focus and selection (`FocusedRowChanged`, `MultiSelect`, `MultiSelectMode`, Selection Binding). |
| 20 | - Implement drag-and-drop between Grid, TreeList, and ListBox via the Drag-and-Drop Behavior. |
| 21 | - Work with `TreeList` nodes programmatically (`AppendNode`, `FocusedNode`, `FindNodeByKeyID`, virtual mode). |
| 22 | - Configure `CardView` layout (card size, caption, row/column counts). |
| 23 | - Save and restore layout to XML, JSON, Stream, or system Registry. |
| 24 | |
| 25 | ## Prerequisites & Installation |
| 26 | |
| 27 | ### NuGet Pac |