WinForms GridView Overview
The data layer of RadGridView supports pagination of data natively as of R1 2014 (version 2014.1.226). You can still bind RadGridView to the same data providers as before with the addition of the paging option. There is a number of features, which will allow you to easily configure and manage the paging of the data.

To access the public API for paging you need to use the RadGridView.MasterTemplate property exposing the MasterGridViewTemplate object. Here are the more important properties and methods:
-
EnablePaging: Gets or sets a value indicating whether paging is enabled.
-
PageSize: Gets or sets the number of items shown per page.
-
TotalPages: Gets the total number of pages.
-
PageIndex: Gets the zero-based index of the current page.
-
CanChangePage: Gets a value indicating whether page change is possible.
-
IsPageChanging: Gets a value indicating whether a page change operation is underway.
-
MoveToFirstPage: Moves RadGridView to its first page.
-
MoveToPreviousPage: Moves RadGridView to the previous page.
-
MoveToPage(int pageIndex): Moves RadGridView to a specific page.
-
MoveToNextPage: Moves RadGridView to the next page.
-
MoveToLastPage: Moves RadGridView to its last page.
-
PagingBeforeGrouping: Gets or sets a value indicating whether paging is performed before grouping or vice versa.
Setting Up Paging
The following example shows how to enable paging, set the page size, and use the navigation methods:
this.radGridView1.EnablePaging = true;
this.radGridView1.PageSize = 10;
// Navigate to a specific page by zero-based index.
this.radGridView1.MasterTemplate.MoveToPage(3);
// Navigate sequentially.
this.radGridView1.MasterTemplate.MoveToFirstPage();
this.radGridView1.MasterTemplate.MoveToNextPage();
this.radGridView1.MasterTemplate.MoveToPreviousPage();
this.radGridView1.MasterTemplate.MoveToLastPage();
// Read paging state.
int currentPage = this.radGridView1.MasterTemplate.PageIndex;
int totalPages = this.radGridView1.MasterTemplate.TotalPages;
Handling Paging Events
RadGridView exposes the PageChanging and PageChanged events. The PageChanging event allows you to cancel a page change. The PageChanged event fires after the page has changed.
private void radGridView1_PageChanging(object sender, PageChangingEventArgs e)
{
// Cancel navigation to the last page.
if (e.NewPageIndex == this.radGridView1.MasterTemplate.TotalPages - 1)
{
e.Cancel = true;
}
}
private void radGridView1_PageChanged(object sender, EventArgs e)
{
string message = string.Format("Page {0} of {1}",
this.radGridView1.MasterTemplate.PageIndex + 1,
this.radGridView1.MasterTemplate.TotalPages);
}