# Grouping

**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 **RadGridView** is not grouped, the **GridViewGroupPanel** shows a customizable hint.

> caption Grouped RadGridView

![Telerik UI for WPF RadGridView grouping interface showing grouped rows and the group panel](https://www.telerik.com/products/wpf/documentation/assets/8fda131014d60d36d0014ab8e6fa6942/radgridview_functionaloverview_grouping_1.png)

You can define grouping either in the XAML or in the code-behind.

**Example 1: Grouping applied through XAML**

```XAML
<telerik:RadGridView x:Name="radGridView"
                AutoGenerateColumns="False">
    <telerik:RadGridView.GroupDescriptors>
        <telerik:GroupDescriptor Member="Country"
                            SortDirection="Ascending" />
        
    </telerik:RadGridView.GroupDescriptors>
</telerik:RadGridView>
```

You can achieve the same result if you define your grouping in the code-behind like this:

**Example 1: Grouping applied programmatically**

```C#
GroupDescriptor descriptor = new GroupDescriptor();
descriptor.Member = "Country";
descriptor.SortDirection = ListSortDirection.Ascending;
descriptor.DisplayContent = "Country Group";
this.radGridView.GroupDescriptors.Add(descriptor);
//You can create and add more descriptors here
```

```VB.NET
Dim descriptor As New GroupDescriptor()
descriptor.Member = "Country"
descriptor.SortDirection = ListSortDirection.Ascending
descriptor.DisplayContent = "Country Group"
Me.radGridView.GroupDescriptors.Add(descriptor)
'You can create and add more descriptors here
```

> Тhe **GroupDescriptors** property of RadGridView is a **collection** so you can add more than one **GroupDescriptor** to a certain **RadGridView**.

> tip Consider using the code-behind approach only when changing the grouping criteria **run-time**.

Check out the chapters entirely dedicated to the grouping functionality of **RadGridView** and find the answers to the following questions:

* How does the [basic grouping](https://www.telerik.com/products/wpf/documentation/controls/radgridview/grouping/basics) work.

* How to [define grouping](https://www.telerik.com/products/wpf/documentation/controls/radgridview/grouping/programmatic-grouping) using **GroupDescriptors** in both XAML and code-behind.

* How to configure [Grouping Modes](https://www.telerik.com/products/wpf/documentation/controls/radgridview/grouping/groupingmodes).

* How to use the exposed [grouping events](https://www.telerik.com/products/wpf/documentation/controls/radgridview/grouping/basics).

* How to [disable](https://www.telerik.com/products/wpf/documentation/controls/radgridview/grouping/basics) the default grouping per column or for the whole **RadGridView** control.

* How to [modify the group panel](https://www.telerik.com/products/wpf/documentation/controls/radgridview/grouping/modifying-group-panel).

* How to group your data by [multiple-columns](https://www.telerik.com/products/wpf/documentation/controls/radgridview/grouping/multiple-column-grouping).

* How to [style the group rows](https://www.telerik.com/products/wpf/documentation/controls/radgridview/styles-and-templates/styling-group-row).

* How to define [aggregate functions](https://www.telerik.com/products/wpf/documentation/controls/radgridview/grouping/aggregates) to the group rows.

* How to use the [group footers](https://www.telerik.com/products/wpf/documentation/controls/radgridview/grouping/group-footers).

## See Also

* [Filtering](https://www.telerik.com/products/wpf/documentation/controls/radgridview/features/overview-filtering)

* [Data Selection](https://www.telerik.com/products/wpf/documentation/controls/radgridview/features/overview-data-selection)

* [UI Virtualization](https://www.telerik.com/products/wpf/documentation/controls/radgridview/features/ui-virtualization)
