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

Set SortingState on Column

Generally, each GridViewColumn enables you to set it in a specific sorting state. This may be easily done by defining its corresponding property SortingState. It may have the following values:

  • Ascending;
  • Descending;
  • None.

As it comes to RadGridView, this approach represents custom sorting logic and as being such, you have to set one more property - IsCustomSortingEnabled:

Example 1: Setting SortingState for a column.

<telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" SortingState="Ascending" IsCustomSortingEnabled="True"/> 
Once you define all the necessary properties, the corresponding column will be set in an Ascending sorting order. Furthermore, you will be able to handle the Sorting event of the RadGridView and perform any additional logic that you need.

For further information on implementing custom sorting you may run through the Custom Sorting article.

See also

In this article