Version

We recommend that you use the xamDataGrid control instead of the xamGrid control. The xamGrid is being planned for retirement over the next few years and will not receive any new features. We will continue to provide support and critical bug fixes for the xamGrid during this time. For help or questions on migrating your codebase to the xamDataGrid, please contact support.

Paging

The xamGrid™ control’s paging mechanism breaks data into pages. The number of pages is determined by the page size and the total number of records from the data source. The xamGrid control retrieves new data for each page as your end users navigate from page to page.

By default Paging is not enabled on your xamGrid. To enable paging, you can set the following properties on the PagerSettings object.

  • AllowPaging – Setting this property enables paging, and also sets where the pager will appear in relation to your grid.

  • CurrentPageIndex – This property sets the current page of the pager you want to navigate to.

  • PageSize – This property sets the number of rows that will appear per page.

The following code demonstrates how to enable paging with the pager appearing on both the top and bottom of the grid, and five rows displayed per page.

In XAML:

<Grid x:Name="LayoutRoot" Background="White">
   <ig:XamGrid x:Name="MyGrid" AutoGenerateColumns="False">
      <ig:XamGrid.PagerSettings>
         <ig:PagerSettings AllowPaging="Both" PageSize="5"/>
      </ig:XamGrid.PagerSettings>
      ...
   </ig:XamGrid>
</Grid>

In Visual Basic:

Imports Infragistics.Controls.Grids
...
Me.MyGrid.PagerSettings.AllowPaging = PagingLocation.Both
Me.MyGrid.PagerSettings.PageSize = 5

In C#:

using Infragistics.Controls.Grids;
...
this.MyGrid.PagerSettings.AllowPaging = PagingLocation.Both;
this.MyGrid.PagerSettings.PageSize = 5;
Paging