ComponentOne GridView for ASP.NET AJAX: GridView for ASP.NET AJAX Task-Based Help > Updating the Grid with AJAX > Paging the Grid

Paging the Grid

You can use AJAX to update the grid when the user pages the grid at run time. For example, you can update the grid with AJAX on grid paging in the Designer, in Source view, and in code. For more information about paging, see Paging and Creating a Pageable Grid.

In the Designer

To enable AJAX when paging through a C1GridView, complete the following steps:

1.   Select the C1GridView control and click the Smart Tag to open the C1GridView Tasks menu.

2.   Select Property builder. The C1GridView Properties dialog box (the Property builder) appears.

3.   Click the Paging tab and select the Allow paging check box in the Paging section.

4.   Click OK to close the Property builder.

5.   With the C1GridView control still selected, click the drop-down arrow next to the CallbackOptions property in the Properties window and check the Paging check box.

In Source View

Switch to Source view and add AllowPaging="True" and CallbackOptions="Paging" 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" AllowPaging="True" CallbackOptions="Paging">

In Code

To enable AJAX when filtering a column, add the following code to the Page_Load event:

      Visual Basic

C1GridView1.AllowPaging = True

C1GridView1.CallbackOptions = CallbackOptions.Paging

      C#

C1GridView1.AllowPaging = true;

C1GridView1.CallbackOptions = CallbackOptions.Paging;

 What You've Accomplished

Run the program and click the paging navigation at the bottom of the grid. Notice that only the grid refreshes as you page through it. The entire page is not reloaded.


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.