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

ASP.NET MVC Grid Pager Functionality

Loading Demo...
  • EXAMPLE
  • VIEW SOURCE
pager_functionality.cshtml
Pager_FunctionalityController.cs
ProductService.cs

Also available for:

CLIENT-SIDE API SERVER-SIDE API

Description

When it is possible to fit all Telerik UI for ASP.NET MVC Grid data items into a single page, you may not need to show a pager.

The Data Grid toggles the pager visibility by using the .Pageable(pager => pager.AlwaysVisible(true)) method. By default, the component will show the pager even when the total amount of items in the DataSource is less than the PageSize.

If the 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 value, the pager will be hidden.
  • When the total amount of items initially set in the DataSource is greater than or equal to the PageSize value, the pager will be shown.
  • When the total amount of items in the DataSource becomes less than the PageSize value after a delete or filter operation, or a change in the PageSize, the pager will be hidden.
  • When the total amount of items in the DataSource becomes greater than or equal to the PageSize value after an insert or filter operation, or a change in the PageSize, the pager will be shown.

In this demo, the alwaysVisible checkbox enables or disables the pageable.alwaysVisible option for the Data Grid. To set the pager position to the top, use the position property of the pager—the pager on top checkbox changes the position of the Pager for the Grid.

Additional Apps

This Grid example is part of a unique collection of hundreds of ASP.NET MVC demos, with which you can see all Telerik ASP.NET MVC components and their features in action. View the source code of the demos from the library or directly adapt, and edit them and their theme appearance in the ThemeBuilder.

Support & Learning Resources

Additional Resources