Version

Please note that this control has been retired and is now obsolete to the XamDataGrid control, and as such, we recommend migrating to that control. It will not be receiving any new features, bug fixes, or support going forward. 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