This example demonstrates how to use sorting in the Soby Data Grid.
"AddOrderByField" method takes two parameters. First one is the name of the field. Second one is a boolean value to state whether it should be sorted as ascending or descending. This method does not trigger data population, it just adds the orderbyfield which will be used on population.

bookGrid.AddOrderByField("Title", true); 

Below functionality uses "SortResult" method which takes two parameters. First one is the name of the field. Second one is a boolean value to state whether it should be sorted as ascending or descending. This method triggers the data population.

bookGrid.SortResult("Title", true); 

Sort by as   

View source
Want to learn more about the grid component? Check out the API documentation.