You can use AJAX to update the grid when the user sorts a column at run time. For example, you can update the grid with AJAX on column sort in the Designer, in Source view, and in code. For more information about sorting, see the Sorting topic.
In the Designer
To enable AJAX when sorting on a column, complete the following steps:
In Source View
Switch to Source view and add AllowSorting="True" and CallbackOptions="Sorting" to the <cc1:C1GridView> tag, so it appears similar to the following:
<cc1:C1GridView ID="C1GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="AccessDataSource1" VisualStylePath="~/C1WebControls/VisualStyles" AllowSorting="True" CallbackOptions="Sorting">
In Code
To enable AJAX when filtering a column, add the following code to the Page_Load event:
To write the code in Visual Basic:
Visual Basic |
Copy Code
|
---|---|
C1GridView1.AllowSorting = True C1GridView1.CallbackOptions = CallbackOptions.Sorting |
To write the code in C#:
C# |
Copy Code
|
---|---|
C1GridView1.AllowSorting = true; C1GridView1.CallbackOptions = CallbackOptions.Sorting; |
What You've Accomplished
Now when you run the program and sort a column, you will notice that only the grid, and not the entire page, refreshes.