Your application must sort tables of information by any column, in ascending or descending order of numeric or text values, that it displays to its users without requiring user intervention (i.e., in a predefined sort order) When sorting by text values, alphabetic (dictionary) sorting should be performed according to the language rules of the application’s culture.
Using a WebGrid control you would set the AllowSortingDefault property on the WebGrid’s DisplayLayout property (or the AllowSorting property to control user-driven sorting on an individual band) to Yes. Then you add the Column(s) that you want to programmatically sort into their Band’s SortedColumns collection, setting each Column’s SortIndicator to indicate either an ascending or descending sort order is desired. Before rendering is completed the rows will be sorted according to the columns in the SortedColumns collection (to re-sort the rows collection immediately you must call the PerformGroupRows method on the WebGrid control.)