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

Paging control for a grouped item

1 Answer 46 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 02 Apr 2019, 10:00 PM

Right now if an item is grouped the paging doesn't seem to break only on group borders. Say there are 7 items in the group in some cases 4 of the items might be displayed on one page and the rest of the 3 displayed on the next. Is there a way to control the paging so that a "break" only occurs on group boundaries?

 

1 Answer, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 04 Apr 2019, 12:55 PM
Hello Kevin,

By default when server operations are enabled, the grid requests only a single page of data from the server. Unfortunately, the grouped data response does not contain information about the count of all groups. In other words, you are not able to determine whether a group is partially displayed within the current page.

You could achieve that by creating an additional dataSource which has server operations disabled and requests the very same action method. Whenever the user groups the grid you will have to apply the same group to the other dataSource. Finally, using the current page and the page size, find which exact set of data is currently displayed and in case the count of all groups within that page exceeds the page size, set the page size of the dataSource to the sum of all items of the groups in the current page.


Regards,
Georgi
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
Kevin
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Share this question
or