ComponentOne GridView for ASP.NET AJAX: Using GridView for ASP.NET AJAX > Paging

Paging

The C1GridView control provides built-in data paging functionality without requiring any coding. By default the grid is displayed in one continuous window. If you choose, you can display the grid on multipage "pages". If paging is set, at run time users can navigate each page of the grid through buttons or links at the top or bottom of the grid. For an example of adding paging, see the Adding Paging topic.

To be able to page data at run time, the AllowPaging property must be set to True (by default this is False). When AllowPaging is True paging navigation appears by default at the bottom of the grid in the grid's footer. You can change the position of the paging controls, if you choose, by setting the Position property. By default, 10 items appear on each page of the grid. You can change this number, by setting the PageSize property. For example, in the image below the PageSize has been set to 4.

By default the paging controls appear as numeric links:

 

 

You can change the appearance of the paging controls by setting the Mode property. You can set the Mode property to the following options:

 

Mode

Description

NextPrevious

A set of pagination controls consisting of Previous and Next buttons.

Numeric (default)

A set of pagination controls consisting of numbered link buttons to access pages directly.

NextPreviousFirstLast

A set of pagination controls consisting of Previous, Next, First, and Last buttons.

NumericFirstLast

A set of pagination controls consisting of numbered and First and Last link buttons.

 

To customize the style of the pager controls, you can set the PagerStyle property. For an example of changing the pager mode and style, see the Changing Paging Types and Styles topic. Note that the paging properties are easily accessed at design time on the Paging tab of the Property builder (the C1GridView Properties dialog box).

You can use AJAX to update the grid when the user pages the grid at run time by setting the CallbackOptions property. For more information, see Paging the Grid.


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