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

Multiple-Column Sorting

The RadGridView control allows you to sort multiple columns. To do this at run-time, hold the Shift key when clicking on the column headers. To change this, refer to the Specify Multiple-Column Sorting Modifier Keys section of this article.

On the snapshot below, the data in RadGridView is sorted ascending by the Est. column and then sorted again by the Stadium column, without removing the previous sorting.

Telerik WPF DataGrid MultiColumnSorting 1

To learn how to implement programmatic sorting in your RadGridView, read on this article.

Column Sort Sequence Indicator

The RadGridView control allows you to display sequence indicators for the sorting operations. To enable this, set the ShowColumnSortIndexes property of RadGridView to True.

You can check how the column headers will look like after the user has sorted on multiple columns.

Telerik WPF DataGrid MultiColumnSorting 2

Specify Multiple-Column Sorting Modifier Keys

RadGridView provides the option to specify the modifier keys when performing multi-column sorting. This is done via the MultipleColumnSortModifiers property of RadGridView and it is of the type of ModifierKeys. The default value of the MultipleColumnSortModifiers property is ModifierKeys.Shift.

Setting the modifier key to the Ctrl key for the multi-column sorting

<telerik:RadGridView ItemsSource="{Binding Clubs}" MultipleColumnSortModifiers="Ctrl"/> 
You can specify multiple modifier keys that will have to be held when clicking on the column headers, in order to execute the multi-column sorting. To specify them, separate them with the + sign when setting the MultipleColumnSortModifiers property.

Setting multiple modifier keys to the MultipleColumnSortModifiers property

<telerik:RadGridView ItemsSource="{Binding Clubs}" MultipleColumnSortModifiers="Ctrl+Shift"/> 

Setting multiple modifier keys to the MultipleColumnSortModifiers property

this.gridView.MultipleColumnSortModifiers = ModifierKeys.Control | ModifierKeys.Shift; 

Setting the MultipleColumnSortModifiers property to an empty value will allow you to sort multiple columns without holding a modifier key.

See Also

In this article