Overview
The GroupDescriptorCollection contains Expression property which is used to create flexible grouping conditions.
Expression is a string that contains the column name followed by "ASC" (ascending) or "DESC" (descending). Columns are sorted ascending by default. Multiple columns can be separated by commas. Multiple grouping descriptors can be separated by semi column symbol.
Creating expressions
Creating a simple expression:
Copy[C#] Creating simple grouping expression
this.radGridView1.GroupDescriptors.Expression = "Country ASC";
Copy[VB.NET] Creating simple grouping expression
Me.RadGridView1.GroupDescriptors.Expression = "Country ASC"
Grouping by two properties using an expression:
Copy[C#] Grouping by two columns, by using an expression
this.radGridView1.GroupDescriptors.Expression = "Country, ContactTitle DESC";
Copy[VB.NET] Grouping by two columns, by using an expression
Me.RadGridView1.GroupDescriptors.Expression = "Country, ContactTitle DESC"
Creating groups on two levels using an expression:
Copy[C#] Creating group on two levels, by using an expression
this.radGridView1.GroupDescriptors.Expression = "Country ASC; ContactTitle DESC";
Copy[VB.NET] Creating group on two levels, by using an expression
Me.RadGridView1.GroupDescriptors.Expression = "Country ASC; ContactTitle DESC"
Grouping by two properties on the first level and by one on the second:
Copy[C#] Complex grouping
this.radGridView1.GroupDescriptors.Expression = "Country, ContactTitle ASC; City DESC";
Copy[VB.NET] Complex grouping
Me.RadGridView1.GroupDescriptors.Expression = "Country, ContactTitle ASC; City DESC"