GridView Control for Windows Forms Set data grouping in grid by using DataGridView component in Windows Forms applications Grouping Expressions to C# GridView
The Kettic GridView control includes the GroupDescriptorCollection which contains Expression property to create flexible grouping conditions for GridView in C# Windows Forms application. The Expression property is able to pass a string which includes the name of the column and the ascending or descending order. The expression property leaves the default setting as ascending to columns. If we are going to group several columns, we need to put commas between the columns as the separation mark and use semi column symbol to separate multiple grouping descriptors. How to Create Expressions in C#
The grid grouping expressions allows users of the control create flexible grouping conditions to GridView for their Windows Forms application. The following are the C# code samples to create grouping expressions for various grouping purposes How to Create Simple Grouping Expressions
C# code for creating simple grouping expression to GridView this.ketticGridView1.GroupDescriptors.Expression = "Product Ascending";
How to Create an Expression for Two Properties
C# code for creating an expression to group two grid columns this.ketticGridView1.GroupDescriptors.Expression = "Product, ProductName Ascending";
How to Create an Expression for Two Levels
C# code for creating an expression to perform data grouping on two levels this.ketticGridView1.GroupDescriptors.Expression = "Product Descending; ProductName Ascending";
How to Create an Expression for Complex Grouping
C# code for creating an expression for complex grouping, like grouping grid data by two properties on the first level and by one on the second this.ketticGridView1.GroupDescriptors.Expression = "Product, ProductName Descending; Price Ascending";
|