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

Programmatic Sorting

Programmatic sorting is performed by adding a SortDescriptor object to the SortDescriptors collection of the control.

For example:

SortDescriptor sd = new SortDescriptor(); 
sd.Member = "ContactTitle"; 
sd.SortDirection = ListSortDirection.Descending; 
this.customersDataSource.SortDescriptors.Add(sd); 
Dim sd As New SortDescriptor() 
sd.Member = "ContactTitle" 
sd.SortDirection = ListSortDirection.Descending 
Me.customersDataSource.SortDescriptors.Add(sd) 

Once the application is loaded, the RadGridView will be visualized as follows: WPF RadDataServiceDataSource Programmatic Sorting

Adding several SortDescriptors to the collection will perform the sorting in the respective order.

In this article