MVC Grid Pageable Page Sizes - including ALL in the list along with other size values.

1 Answer 972 Views
Grid Pager
Eddie
Top achievements
Rank 1
Eddie asked on 15 Jul 2022, 03:37 PM

We have a Kendo grid that can display anywhere from 10 to thousands of rows.  We want to be able to set the grid page size to several values, including ALL.

What we have now - without ALL works:

.Pageable(p => p
     .PageSizes(new[] { 100, 200, 500, 1000, 2000 })

When we run this - we see the correct values in the "Items per page" dropdown.

We want to add the "All" option to this dropdown, but the following is not working (compile error)
.Pageable(p => p
     .PageSizes(new[] { 100, 200, 500, 1000, 2000, "All" })

How do we include All along with other values in the Items per page?

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 20 Jul 2022, 10:34 AM

Hello Eddie,

 

Thank you for writing to us.

You can achieve this requirement using the following syntax:

Pageable(x => x.PageSizes(new List<object> { 10, 20, "all" }).Refresh(true))
More info you can find here:
https://www.telerik.com/forums/how-to-set-grid-pagesize-%27all%27-by-wrapper

Feel free to give this a try and let me know if it helps you.

 

Regards,
Eyup
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Grid Pager
Asked by
Eddie
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or