$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Data Grid WinForms Control
Create data gird view in C# with modern user interface for your Windows Forms applications
Home > WinForms UI Controls > User Manual > Data Grid Grouping in C#

Grouping in Data in C# for Grid View

The Data Grid Control provides easy implementation of grouping data in multiple levels in a single table. It is able to group data in different criteria and create a tree of groups to keep the data records. The grouping function can be simply dragged and dropped to the Windows Form project. Furthermore, the Kettic Grid Component fully support customization of grouping, like sum, minimize, maximize, count, first and last as well headers formatting.

How to Group Data in C# for Grid

While using the Kettic Data Grid Control to group data, the grouping options are gathered in a special area, the GroupingGridPanel. When users perform the grouping grid data, the group fields will display in the group panel as elements according to the sort order, such as alphabetic, minimize, and maximize. The Kettic Data Grid Control supports the feature of adding or rearranging the data grouping by dragging and dropping the header of the column to apply data grouping. Users of the Data Grid Control can find more details on end user data grid grouping behavior building.

Properties of Data Grid Grouping

The Kettic Data Grid View Control provides the following Grid View Template properties to control the grid grouping behavior.
  • EnableGrouping, this property is used to switch data grid grouping applying between C# code and drag and drop. The default value of this property is True.
  • AllowDragToGroup, this property is used to allow the end user to drag column headers and drop to the grouping panel. The default value of this property is True.
  • AutoExpandGroups, this property is used to expand groups automatically while adding any grouping expressions either in C# or by drag and drop. The default value of this property is False.

Sort Grid Data in C#

When the data grid is grouped, users of the Grid View Control are able to sort grid data additionally by using the grid sorting as default. The sample below demonstrates how to add the GroupDescriptors in C#, and allow the users not to group grid data through drag and drop.

this.ketticGridView.MasterTemplate.EnableGrouping = true;
this.ketticGridView.MasterTemplate.AllowDragToGroup = false;
this.ketticGridView.MasterTemplate.AutoExpandGroups = true;

Hide GroupPanel in C#

While using the group data grid function, users can hide the group panel by using a simple C# code snippet as below.

this.ketticGridView.DisplayGroupPanel = false;

Create Grouping for C# GridView

The following are details that shows how to create grouping for GridView in C# Windows Forms applications, such as setting GridView grouping, create custom grouping for GridView, groups collection, and formatting group header rows.
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls