New to Telerik UI for ASP.NET MVC? Download free 30-day trial

Pager Functionality

Loading Demo...
  • EXAMPLE
  • VIEW SOURCE
  • Edit in Theme Builder
  • pager_functionality.cshtml
  • Pager_FunctionalityController.cs
  • ProductService.cs

Also available for:

API REFERENCE

Description

It often turns out that all items in the gird can fit into a single page and then showing the pager might not be necessary.

Starting from ASP.NET MVC 2017 R3 release grid toggles the pager visibility using the pageable.alwaysVisible configuration property. By default the grid will show the pager even when total amount of items in the DataSource is less than the pageSize.

If value is set to false the behavior will be as follows:

  • when the total amount of items initially set in the DataSource is less than the pageSize number the pager will be hidden.
  • when the total amount of items initially set in the DataSource is greater than or equal to the pageSize number the pager will be shown.
  • when the total amount of items in the DataSource becomes less than the pageSize number (after delete, filter operation or pageSize change) the pager will be hidden.
  • when the total amount of items in the DataSource becomes greater than or equal to the pageSize number (after an insert, filter operation or pageSize change) the pager will be shown.

In the demo alwaysVisible checkbox enables/disables the pageable.alwaysVisible option for the grid.

In order to set the Pager position at top, use the position property of the Pager.

In the demo "pager on top" checkbox changes the position of the Pager for the grid.

Support & Learning Resources