To configure the grid to automatically sort a column, complete the following steps:
To write the code in Visual Basic:
Visual Basic |
Copy Code
|
---|---|
C1GridView1.AllowSorting = True |
To write the code in C#:
C# |
Copy Code
|
---|---|
C1GridView1.AllowSorting = true; |
Set the C1GridView.DataSourceID property.
Run your application and click the HeaderText of the column you want to sort.
Sample Project Available
For the complete sample, see the Sorting page located in the ControlExplorer sample. See GridView for ASP.NET Web Forms Samples for more information.