This is a migrated thread and some comments may be shown as answers.

Grid Page Size 'All'

3 Answers 4533 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 13 Jan 2016, 04:28 PM

I am currently debugging some issues we are having with trying to enable the 'All' option for page sizes.  Based on what I've found out, it appears as if the <select> that holds the page size options is setting the value for All to 'All' instead of the total number of records.  Is this how this is supposed to work?

 

Is there a list of common issue with trying to get this to work I can try to look through?

 I can add 

          pageable: {  
                        pageSizes: [ 10,25,50,100,'All' ],  
                        buttonCount: 5, 
                        message: {
                                  empty: 'No Data',
                                  allPages:'All'
                                 }
                          }  , 

This adds an 'All' option, but if you select it nothing happens.

I can add the following to the end of my $(document).Ready()

var pageSizes = [{ text: \"10\", value: 10 }, { text: \"25\", value: 25 }, { text: \"50\", value: 50 }, { text: \"100\", value: 100 },{ text: \"All\", value:" + Data_Table.Rows.Count + "  }];
$('.k-pager-sizes select[data-role=\"dropdownlist\"]').data('kendoDropDownList').setDataSource(new kendo.data.DataSource({ data: pageSizes }));

Which helps, but seems like a hack.

Any advice would be greatly appreciated.

3 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 15 Jan 2016, 07:34 AM
Hello Matt,

The "all" value is supported in the pageSizes array like is described in the following help article: http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-pageable.pageSizes
Additionally I tested it in my side and it works as expected. Here is a live example of using it:
http://dojo.telerik.com/UZOYI
Please check it out and let me know what differs in your case.

Looking forward for your reply.

Regards,
Radoslav
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Jon
Top achievements
Rank 1
answered on 11 Mar 2019, 02:50 AM
I find the lack of MVC documentation for things like this be abhorrent
0
Alex Hajigeorgieva
Telerik team
answered on 12 Mar 2019, 12:46 PM
Hello, Jon,

I am sorry to hear that you are disappointed in the Kendo UI ASP.NET MVC Documentation. The relevant link may have been hard to find with navigation at the moment because the Fluent API tree is rather large to navigate but the new search bar found it:

https://docs.telerik.com/aspnet-mvc/api/Kendo.Mvc.UI.Fluent/PageableBuilder



We do have a staff member who is currently working on improving the API section for both MVC and Core by separating the articles into folders that should make things easier to navigate until then, try the search for a better experience or the IntelliSense:



Searching just in the documentation, not the API returns this article which shows an example usage of page sizes:

https://docs.telerik.com/aspnet-mvc/helpers/grid/configuration#pagesizes

In addition to that the answer is available in an MVC forum thread (this is a jQuery forum):

https://www.telerik.com/forums/how-to-set-grid-pagesize-'all'-by-wrapper#k-MP-vPuMEqmtN0fRG7vig

Nonetheless, an example usage for setting the "All" option is indeed missing from the documentation site, so I have logged an internal task to add the "all" option in the MVC documentation example above. Let me know in case you had other ideas of what we should show in the documentation.

Thank you very much for your feedback.

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Matt
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Jon
Top achievements
Rank 1
Alex Hajigeorgieva
Telerik team
Share this question
or