RadControls for WPF

The RadGridView provides you with a built-in grouping functionality, which allows the user to easily group the data by one or more columns. To do so the user has to just drag the desired column to the GridViewGroupPanel located at the top of the RadGridView. If the RadGridView is not grouped, the GridViewGroupPanel shows a hint.

After dropping the selected header in the grouping area, the text message will be replaced with a rectangle that represents the selected header and the data in the RadGridView will be properly grouped.

To remove the grouping just click the close button of the rectangle or drag it out of the grouping area.

The RadGridView also provides the user with a way to sort the groups of data. To do that the user just has to click on the rectangle that represents the grouping column. By default, when the data is grouped, the groups are sorted ascending. When the sort direction of the rectangle is none the groups are sorted depending on the data they contain.

Tip
The data can be grouped by more than one column. To do that just drag another column into the grouping area and the data will be grouped against these two criteria. To learn more about the multi-column grouping take a look at the Multi-Column Grouping topic.

Grouping Modes

As of Q3 2012 we have introduced a new property of the RadGridView GroupRenderMode. It has two options:

Nested Mode: It is the default one and it will nest GridViewGroupRows into one another when you have grouping on many levels. This may lead to a poor performance when the grid is grouped on several levels and has a lot of data. The visual element representing the grouped row is GridViewGroupRow.

Flat Mode: This mode simply renders rows one below the other. This leads to a very good perfromance when the grid is grouped on several levels and has a lot of data. The visual element representing the grouped row is GroupHeaderRow.

Note

Please note that when you use the Flat Mode, you should work with GroupHeaderRow, not GridViewGroupRow.

Disabling Grouping

There are two ways to disable the built-in grouping of the RadGridView. The first one is at the RadGridView level via the ShowGroupPanel property. By setting it to False the grouping area gets hidden and the column headers have nowhere to be dropped. The default value is True.

CopyXAML
<telerik:RadGridView x:Name="radGridView" ShowGroupPanel="False"/>

The second way is to disable it on column level via IsGroupable property. When set to False the column is not allowed to be dropped in the grouping area.

CopyXAML
<telerik:GridViewDataColumn DataMemberBinding="{Binding Title}"
                                Header="Title"
                                UniqueName="Title"
                                IsGroupable="False" />
CopyC#
this.radGridView.Columns[ "Title" ].IsGroupable = false;
CopyVB.NET
Me.radGridView.Columns("Title").IsGroupable = False

Events

There are two events that are raised, when the data in the RadGridView is grouped. The first one is the Grouping event and is raised before the data is grouped. The second one is the Grouped event and is raised when the data has been already grouped. You can find more information about them here.

Styling and Appearance

The RadGridView provides you with several ways to style the default look and appearance of the built-in grouping functionality. You can manipulate the grouping area at the top of the RadGridView. To learn how to do this take a look at the Modifying the Grouping Panel topic.

You can also manipulate the visual appearance of the group footers. Just set the GroupFooterCellStyle property of the GridViewColumn to an appropriate style. To learn more about the group footers take a look at the Group Footers topic. To learn how to style them take a look at the Styling the Group Footers topic.

See Also