New to Telerik UI for WinForms? Download free 30-day trial

Using Grouping Expressions

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 examples

Creating simple grouping expression

this.radGridView1.GroupDescriptors.Expression = "Country ASC";

Me.RadGridView1.GroupDescriptors.Expression = "Country ASC"

Grouping by two columns, by using an expression

this.radGridView1.GroupDescriptors.Expression = "Country, ContactTitle DESC";

Me.RadGridView1.GroupDescriptors.Expression = "Country, ContactTitle DESC"

Creating group on two levels, by using an expression

this.radGridView1.GroupDescriptors.Expression = "Country ASC; ContactTitle DESC";

Me.RadGridView1.GroupDescriptors.Expression = "Country ASC; ContactTitle DESC"

Complex grouping

this.radGridView1.GroupDescriptors.Expression = "Country, ContactTitle ASC; City DESC";

Me.RadGridView1.GroupDescriptors.Expression = "Country, ContactTitle ASC; City DESC"

See Also

In this article