Version

Enabling Paging

Before You Begin

WebHierarchicalDataGrid™ provides paging functionality to present data in smaller subsets displayed as pages. To enable paging, add the Paging behavior to the Behaviors collection.

What You Will Accomplish

You will learn how to enable basic paging for WebHierarchicalDataGrid and set several options for paging.

Follow these Steps

  1. Bind WebHierarchicalDataGrid to the WebHierarchicalDataSource™ component retrieving data from the Categories and Products table. For more information on doing this, see the Using the WebHierarchicalDataSource topic.

  2. In the Microsoft® Visual Studio™ property window, locate the Behaviors property and click the ellipsis (…​) button to launch the Behaviors Editor Dialog.

  3. Check the CheckBox next to Paging from the list on the left to add and enable the behavior.

  4. In the properties, set PageSize to 5, increasing the number of records per page to 5.

  5. Set PagerMode to NumericFirstLast which changes the pager links to numbers with links to the first and last pages.

  6. Set the EnableInheritance property to True, to enable Paging for all child levels. The default value is False.

WebHierarchicalDataGrid Enabling Paging 01.png

Click Apply then OK. You have enabled paging for the parent and child levels with some Pager settings at design time.

Note
Note:

In order to use Paging behavior in conjunction with Sorting, DataKeyFields need to be set for each band in the HierarchicalDataGrid.

WebHierarchicalDataGrid Enabling Paging 02.png

You can also use the following code examples for enabling paging.

In HTML:

<ig:WebHierarchicalDataGrid ID="WebHierarchicalDataGrid1" runat="server"
        Height="350px" Width="400px">
        <Behaviors>
            <ig:Paging EnableInheritance="True" PagerMode="NumericFirstLast" PageSize="5">
            </ig:Paging>
        </Behaviors>
    </ig:WebHierarchicalDataGrid>

In Visual Basic:

Me.WebHierarchicalDataGrid1.Behaviors.Paging.PagerMode = _
    Infragistics.Web.UI.GridControls.PagerMode.NumericFirstLast
Me.WebHierarchicalDataGrid1.Behaviors.Paging.PageSize = 5
Me.WebHierarchicalDataGrid1.Behaviors.Paging.EnableInheritance = True

In C#:

this.WebHierarchicalDataGrid1.Behaviors.Paging.PagerMode =
    Infragistics.Web.UI.GridControls.PagerMode.NumericFirstLast;
this.WebHierarchicalDataGrid1.Behaviors.Paging.PageSize = 5;
this.WebHierarchicalDataGrid1.Behaviors.Paging.EnableInheritance = true;