/syncfusion-winforms:syncfusion-winforms-datagridfrom Syncfusion WinForms Controls
Implements Syncfusion WinForms SfDataGrid component for displaying and managing tabular data in Windows Forms applications. Use this when working with data grids, column management (auto-generation, stacked headers), data operations (filtering, sorting, grouping), or grid editing with validation. The skill covers data summaries, selection modes, export capabilities (Excel/PDF), conditional styling, master-detail views, and drag-and-drop functionality.
Ships in Syncfusion WinForms Controls. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A comprehensive guide for implementing the Syncfusion Windows Forms DataGrid (SfDataGrid) component, a powerful control for displaying and manipulating tabular data with features like columns, filtering, sorting, grouping, editing, summaries, and export capabilities.
Use this skill when you need to:
The Syncfusion WinForms DataGrid (SfDataGrid) is a high-performance data grid control that provides:
Create the SfDataGrid control programmatically:
using Syncfusion.WinForms.DataGrid;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
private SfDataGrid sfDataGrid1;
public Form1()
{
InitializeComponent();
// Create SfDataGrid instance
sfDataGrid1 = new SfDataGrid();
// Add to form's controls collection
this.Controls.Add(sfDataGrid1);
}
}
}
📄 Read: references/getting-started.md
When you need to:
📄 Read: references/columns.md
When you need to:
📄 Read: references/editing.md
When you need to:
📄 Read: references/filtering.md
When you need to:
📄 Read: references/sorting.md
When you need to:
📄 Read: references/grouping.md
When you need to:
📄 Read: references/selection.md
When you need to:
📄 Read: references/summaries.md
When you need to:
📄 Read: references/export.md
When you need to:
📄 Read: references/styling.md
When you need to:
📄 Read: references/advanced-features.md
When you need to:
Here's a complete step-by-step example to create a working WinForms DataGrid application from scratch:
First, create classes to represent your data:
using System;
using System.Collections.ObjectModel;
public class OrderInfo
{
public int OrderID { get; set; }
public string CustomerID { get; set; }
public string CustomerName { get; set; }
public string Country { get; set; }
public string ShipCity { get; set; }
public OrderInfo(int orderId, string customerName, string country, string customerId, string shipCity)
{
this.OrderID = orderId;
this.CustomerName = customerName;
this.Country = country;
this.CustomerID = customerId;
this.ShipCity = shipCity;
}
}
public class OrderInfoCollection
{
private ObservableCollection<OrderInfo> _orders;
public ObservableCollection<OrderInfo> Orders
{
get { return _orders; }
set { _orders = value; }
}
public OrderInfoCollection()
{
_orders = new ObservableCollection<OrderInfo>();
GenerateOrders();
}
private void GenerateOrders()
{
_orders.Add(new OrderInfo(1001, "Maria Anders", "Germany", "ALFKI", "Berlin"));
_orders.Add(new OrderInfo(1002, "Ana Trujilo", "Mexico", "ANATR", "Mexico D.F."));
_orders.Add(new OrderInfo(1003, "Antonio Moreno", "Mexico", "ANTON", "Mexico D.F."));
_orders.Add(new OrderInfo(1004, "Thomas Hardy", "UK", "AROUT", "London"));
_orders.Add(new OrderInfo(1005, "Christina Berglund", "Sweden", "BERGS", "Lula"));
_orders.Add(new OrderInfo(1006, "Hanna Moos", "Germany", "BLAUS", "Mannheim"));
_orders.Add(new OrderInfo(1007, "Frederique Citeaux", "France", "BLONP", "Strasbourg"));
_orders.Add(new OrderInfo(1008, "Martin Sommer", "Spain", "BOLID", "Madrid"));
_orders.Add(new OrderInfo(1009, "Laurence Lebihan", "France", "BONAP", "Marseille"));
_orders.Add(new OrderInfo(1010, "Elizabeth Lincoln", "Canada", "BOTTM", "Tsawassen"));
}
}
using System;
using System.Windows.Forms;
using Syncfusion.WinForms.DataGrid;
using Syncfusion.WinForms.DataGrid.Enums;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
private SfDataGrid sfDataGrid1;
public Form1()
{
InitializeComponent();
InitializeDataGrid();
}
private void InitializeDataGrid()
{
// Create DataGrid instance
sfDataGrid1 = new SfDataGrid();
sfDataGrid1.Dock = DockStyle.Fill;
// Create and bind data source
OrderInfoCollection collection = new OrderInfoCollection();
sfDataGrid1.DataSource = collection.Orders;
// Enable features
sfDataGrid1.AllowEditing = true;
sfDataGrid1.AllowFiltering = true;
sfDataGrid1.AllowSorting = true;
sfDataGrid1.AllowGrouping = true;
sfDataGrid1.ShowGroupDropArea = true;
// Configure selection
sfDataGrid1.SelectionMode = GridSelectionMode.Extended;
// Auto-generate columns from data model
sfDataGrid1.AutoGenerateColumns = true;
// Add to form
this.Controls.Add(sfDataGrid1);
}
}
}
If you want full control over columns instead of auto-generation:
private void InitializeDataGrid()
{
sfDataGrid1 = new SfDataGrid();
sfDataGrid1.Dock = DockStyle.Fill;
// Disable auto-generation to define columns manually
sfDataGrid1.AutoGenerateColumns = false;
// Add columns with specific properties
sfDataGrid1.Columns.Add(new GridTextColumn()
{
MappingName = "OrderID",
HeaderText = "Order ID",
Width = 100,
AllowEditing = false // Make this column read-only
});
sfDataGrid1.Columns.Add(new GridTextColumn()
{
MappingName = "CustomerID",
HeaderText = "Customer ID",
Width = 120
});
sfDataGrid1.Columns.Add(new GridTextColumn()
{
MappingName = "CustomerName",
HeaderText = "Customer Name",
Width = 150
});
sfDataGrid1.Columns.Add(new GridTextColumn()
{
MappingName = "Country",
HeaderText = "Country",
Width = 120
});
sfDataGrid1.Columns.Add(new GridTextColumn()
{
MappingName = "ShipCity",
HeaderText = "Ship City",
Width = 120
});
// Bind data source
OrderInfoCollection collection = new OrderInfoCollection();
sfDataGrid1.DataSource = collection.Orders;
// Enable features
sfDataGrid1.AllowSorting = true;
sfDataGrid1.AllowFiltering = true;
sfDataGrid1.AllowGrouping = true;
sfDataGrid1.ShowGroupDropArea = true;
// Add to form
this.Controls.Add(sfDataGrid1);
}
When you run the application:
The DataGrid supports various data source types:
// Bind to ObservableCollection (recommended for automatic UI updates)
ObservableCollection<OrderInfo> orders = new ObservableCollection<OrderInfo>();
sfDataGrid1.DataSource = orders;
// Bind to List
List<OrderInfo> orderList = new List<OrderInfo>();
sfDataGrid1.DataSource = orderList;
// Bind to DataTable
DataTable dataTable = new DataTable();
sfDataGrid1.DataSource = dataTable;
// Bind to BindingList
BindingList<OrderInfo> bindingList = new BindingList<OrderInfo>();
sfDataGrid1.DataSource = bindingList;
// Handle selection changed
sfDataGrid1.SelectionChanged += (sender, e) =>
{
if (sfDataGrid1.SelectedItem != null)
{
var selectedOrder = sfDataGrid1.SelectedItem as OrderInfo;
Console.WriteLine($"Selected: {selectedOrder.CustomerName}");
}
};
## Common Patterns
### Manual Column Definition with Selection
```csharp
sfDataGrid.AutoGenerateColumns = false;
// Add columns
sfDataGrid.Columns.Add(new GridTextColumn()
{
MappingName = "OrderID",
HeaderText = "Order ID",
AllowEditing = false
});
sfDataGrid.Columns.Add(new GridNumericColumn()
{
MappingName = "Quantity",
HeaderText = "Qty"
});
// Configure selection
sfDataGrid.SelectionMode = GridSelectionMode.Multiple;
sfDataGrid.SelectionUnit = SelectionUnit.Row;
DataSource - The data source to bindAutoGenerateColumns - Enable/disable automatic column generationAllowEditing - Enable/disable editingAllowFiltering - Enable/disable filteringAllowSorting - Enable/disable sortingAllowGrouping - Enable/disable groupingAllowDraggingColumns - Enable/disable column reorderingAllowDraggingRows - Enable/disable row reorderingSelectionMode - Single, Multiple, Extended, NoneSelectionUnit - Row, Cell, AnySelectedItem - Get/set selected itemSelectedItems - Get/set multiple selected itemsHeaderRowHeight - Height of header rowRowHeight - Default row heightStyle - Grid styling optionsShowGroupDropArea - Show/hide group drop areaShowRowHeader - Show/hide row headersDisplay orders with filtering by status, sorting by date, grouping by customer, editing for updates, and conditional styling for priority orders.
Show transaction data with summaries (totals, averages), export to Excel/PDF, conditional styling for negative values, and master-detail for transaction details.
Track products with filtering by category, low-stock conditional styling, editing for quantity updates, and selection for bulk operations.
Manage contacts with multi-column sorting, grouping by region, export capabilities, and custom rendering for status indicators.
Display tasks with master-detail for subtasks, drag-drop for reordering, conditional styling by status, and summaries for progress tracking.
For common issues and solutions:
Refer to the specific reference files above for detailed troubleshooting guidance in each feature area.
Start with Getting Started to install and configure the SfDataGrid, then explore specific features through the navigation guide above based on your application requirements.
references/advanced-features.md (opens in a new tab)references/columns.md (opens in a new tab)references/editing.md (opens in a new tab)references/export.md (opens in a new tab)references/filtering.md (opens in a new tab)references/getting-started.md (opens in a new tab)references/grouping.md (opens in a new tab)references/selection.md (opens in a new tab)references/sorting.md (opens in a new tab)references/styling.md (opens in a new tab)references/summaries.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub syncfusion/boldcreate-plugins --plugin syncfusion-winforms113 skills in this plugin
/syncfusion-winforms-ai-assistviewGuide for implementing Syncfusion Windows Forms AI AssistView (SfAIAssistView) for building conversational AI interfaces in desktop applications. Use this when creating chat interfaces, AI assistants, or chatbots with Windows Forms. Supports OpenAI and Azure OpenAI integration, typing indicators, chat suggestions, message bubbles, custom views, input toolbar with attachments, response toolbar actions, and stop responding for interactive messaging experiences./syncfusion-winforms-autocompleteGuides implementation of the Syncfusion WinForms AutoComplete control for text input with auto-suggestion functionality. Use when users want to add autocomplete textboxes, implement auto-suggestion features, create search boxes with suggestions, enable URL/email autocomplete, or build type-ahead search functionality in Windows desktop applications. Covers data binding, customization, filtering, multi-column dropdowns, events, and all AutoComplete-specific features./syncfusion-winforms-autolabelGuides implementation of the Syncfusion WinForms AutoLabel control for automatic label positioning with form controls. Use when users want to add labels that automatically reposition when controls move, create form layouts with paired label-control units, implement complex form designs with FlowLayout, or ensure labels stay synchronized with their associated controls. Covers labeling controls, positioning, spacing, size settings, theming, and events.Other plugins' skills for the same job