Task-Based Help / Formatting the Grid's Content / Creating Sorted Grid
In This Topic
Creating Sorted Grid
In This Topic

To configure the grid to automatically sort a column, complete the following steps:

  1. Select the C1GridView control and set the C1GridView.AllowSorting property to True.

    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;
  2. Set the C1GridView.DataSourceID property.    

  3. 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.

See Also