How do we sort data in a GridView?

The SqlDataSource control supports sorting when its DataSourceMode property is set to "DataSet". To enable the sorting UI in the GridView, set the AllowSorting property to true. This causes the GridView to render link buttons for its column headers that can be clicked to sort a column. The GridView control passes the SortExpression associated with the column field to the data source control, which returns the sorted data to the GridView.

No comments:

Post a Comment