GridView.Sort Method (String, SortDirection)
Sorts the GridView control based on the specified sort expression and direction.
Assembly: System.Web (in System.Web.dll)
abstract Sort : sortExpression:string * sortDirection:SortDirection -> unit override Sort : sortExpression:string * sortDirection:SortDirection -> unit
Use the GridView control using the specified sort expression and direction. The sort expression specifies the column or columns with which to sort. To sort multiple columns, create a sort expression that contains a comma-separated list of field names. The sort direction indicates whether sorting is performed in ascending or descending order. This method is commonly used when you need to sort the GridView control from outside of the control, such as from a different control on the page. This method is also commonly used to programmatically set a default sort order for the GridView control when it is first rendered. Calling this method also raises the Sorted and Sorting events.method to programmatically sort the
Available since 2.0