Grid pageSize "All" - bug or expected behavior?

1 Answer 11 Views
Grid Pager
Vedad
Top achievements
Rank 2
Bronze
Iron
Veteran
Vedad asked on 08 Sep 2022, 08:59 AM

Hi,

I would like to have paging on my grid and I am using standard paging options as recommended.

However one of users would like to start with option "Show all", and I can achieve this with setting page sizes, but not pageSize property. Grid automatically falls back to All, which is ok - display of number of records is broken in this case, and instead of showing 135 - 135 of 135 items, it says NaN - NaN of 135 items.

Is the way I am setting grid to use all as default wrong or there is a bug with this behavior?

For the example of behavior, please see the demo

Regards,

Vedad

1 Answer, 1 is accepted

Sort by
0
Georgi Denchev
Telerik team
answered on 13 Sep 2022, 07:22 AM

Hello, Vedad,

Thank you for the provided Dojo.

The pageSize configuration of the dataSource must always be defined, otherwise you'll observe the described behavior. If you want to select "all" as the default value, you need to set the pageSize to be equal to the total amount of records.

  let ds = $("#grid").data("kendoGrid").dataSource;
  
  ds.pageSize(ds.total());

Dojo

https://dojo.telerik.com/@gdenchev/ULOCuhiV 

Best Regards,
Georgi Denchev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid Pager
Asked by
Vedad
Top achievements
Rank 2
Bronze
Iron
Veteran
Answers by
Georgi Denchev
Telerik team
Share this question
or