New to Telerik UI for WinFormsStart a free 30-day trial

Using Grouping Expressions

Updated over 6 months ago

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

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

Grouping by two columns, by using an expression

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

Creating group on two levels, by using an expression

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

Complex grouping

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

See Also