Sorts the System.Web.UI.WebControls.GridView control based on the specified sort expression and direction.
- newSortExpression
- Documentation for this section has not yet been entered.
- newSortDirection
- Documentation for this section has not yet been entered.
Use the GridView.Sort(string, SortDirection) method to programmatically sort the System.Web.UI.WebControls.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 System.Web.UI.WebControls.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 System.Web.UI.WebControls.GridView control when it is first rendered. Calling this method also raises the GridView.Sorted and GridView.Sorting events.