Overview
The SortDescriptors Collection exposes the Expression property which is used to create flexible sorting conditions.
Expression is a string that contains the column name followed by "ASC" (ascending) or "DESC" (descending). Columns are sorted ascending by default. Multiple columns can be separated by commas.
Creating expressions
Creating a simple expression:
Copy[C#] Creating simple sorting expression
this.radGridView1.SortDescriptors.Expression = "ShipName ASC";
Copy[VB.NET] Creating simple sorting expression
Me.RadGridView1.SortDescriptors.Expression = "ShipName ASC"
Sorting by two columns using expressions:
Copy[C#] Sorting by two columns, using sorting expression
this.radGridView1.SortDescriptors.Expression = "ShipName ASC, Freight DESC";
Copy[VB.NET] Sorting by two columns, using sorting expression
Me.RadGridView1.SortDescriptors.Expression = "ShipName ASC, Freight DESC"