Displaying all Grid records by using the built-in DropDownList in the Pager
Environment
Product | Progress® Kendo UI for Angular Grid |
Description
How to display all Grid records by using the built-in DropDownList in the Pager?
Solution
-
Implement a
kendoPagerTemplate
and define the built-inPagerPageSizesComponent
inside the template.<ng-template kendoPagerTemplate> <kendo-pager-page-sizes></kendo-pager-page-sizes> </ng-template>
-
Create an array of
PageSizeItem
objects and define an object with valueall
.public pageSizes: PageSizeItem[] = [ { text: 'All', value: 'all' }, ... ];
-
Finally, bind the
pageSizes
property of thePagerPageSizesComponent
to the collection ofPageSizeItem
objects.<ng-template kendoPagerTemplate> <kendo-pager-page-sizes [pageSizes]="pageSizes" > </kendo-pager-page-sizes> </ng-template>
The following example demonstrates how to implement the described approach.