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

Data Grouping only works on the current page

3 Answers 353 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Reid
Top achievements
Rank 2
Reid asked on 21 May 2019, 10:16 PM

Using Kendo MVC and bind to the grid in a typical way.  If the data set as a whole contains values in a column in a row not displaying in the current page the grouping feature does not see it.

How can you handle this?  Does this page size need to be adjusted in a client side OnGrouping event fires?

Any suggestions appreciated.

3 Answers, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 24 May 2019, 02:27 PM
Hi Reid,

The grouping functionality of the Kendo UI Grid is executed on the client-side. When the grid uses server paging and does not load the whole data, the grouped items would be only on the current page. In order to perform grouping on the whole data there are two approaches that might be undertaken:

1. Set the ServerOperations(false) for the data source of the grid. This would load the whole data to the grid with the very first request and all of the client-side functionalities would be performed all data items.

2. Handle the grouping on the server-side. When the server operations are in use, the grid would send a request to the server containing the Group object. the field and the direction are sent. Based on which, you can create a query, request the relevant data and return them to the grid afterwards. More information could be found here:

https://docs.telerik.com/kendo-ui/api/javascript/data/datasource/configuration/servergrouping

Let me know in case additional assistance is required.


Kind regards,
Tsvetomir
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.
0
Reid
Top achievements
Rank 2
answered on 07 Jun 2019, 03:13 PM

Hi Tsvetomir,

I set the grid with #1 above you suggest and that in itself is not working because I can first manually page down and observe a value in a column that does not exist on the first page, then use that column as the grouping column from the first page (drag and drop) and that group  do not show that value that exists on the second page.

I am not sure about #2 above.

Are you aware of any examples that show this working with the group feature including all records in the data set?

0
Tsvetomir
Telerik team
answered on 12 Jun 2019, 09:52 AM
Hi Reid,

The grouping functionality of the Kendo UI Grid first sorts the whole data set and then creates the individual groups. The page sizes are applicable. So, in case the values from second page do not get fit on the first page, they are transferred to the next one. Also, the grouping functionality works for the column itself rather than the values. 

For instance, if you group the column ID, and the data item with value 25 is on the second page and the page size of the grid is 20, then on the first page there would be groups with items with values less than 25. The grouping would obey the paging of the grid. 

I am attaching a sample project for your reference. It has the .ServerOperation(false) property set. So, the grouping would be made for the whole data set. I have noticed that I have made a typo in my previous response and the property should not be in plural but as follows - ServerOperation.

The column by which the grid should be grouped in order to see the changes is named "Freight". What basically happens is that the value 10 is occurs on every page of the grid. However, when the grid is grouped, it is shown as one group on the first page.

Let me know in case further clarifications are needed. 


Kind regards,
Tsvetomir
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
Reid
Top achievements
Rank 2
Answers by
Tsvetomir
Telerik team
Reid
Top achievements
Rank 2
Share this question
or