Hello,
I'm currently working on a kendo grid where sorting and groupping are enabled.
when I sort the grid depending on one or more columns, the grid is sorted as expected, however if I choose to group the grid according to any column afterwards, the sorting gets cancelled.
I understand that this has been an issue raised before since kendo didn't support it. but is it still the case?
Is there a workaround for this?
6 Answers, 1 is accepted
Hello Safa,
There are two types of sort:
- When you group and click on the column header sorting is applied over the items inside the group. If you need to sort the groups, i.e group headers, you should click over the group item above grid header. When grouping is applied through the UI default sort order of the group is ascending. However if there is sort applied over other fields, their sort order will be preserved within the group.
- When there isn't grouping applied - sorting is applied over the whole set of data item.
Maybe this is where confusion comes from.
Regards,Nikolay Rusev
Telerik
Hello Nikolay,
thanks for your reply.
I will try to explain my problem a bit more. I'm speaking about the case when I have:
1) populated the grid
2) applied sorting using column headers therefore the current data displayed will be sorted
3) finally i have applied groupping
my problem is that my sorting preferences at this point will be lost.
Hello Safa,
The Kendo UI Grid preserves the sort order after grouping. If we take for example the Kendo UI Grid demo below, sort by name and then group by country, the names will remain sorted:
Please try to recreate the issue using this example, so I can investigate the cause and make suggestions.
Meanwhile, if you have any further questions regarding the grouping and sorting functionality of the Kendo UI Grid, I will be pleased to assist.
Kind Regards,Alex
Telerik
Hi Nikolay,
How can I sort rows within of group by invisible filed (e.g., id). Please find my example http://jsfiddle.net/iakhmedov1/T64Kb/93/
Thanks,
Igor
Hello Nikolay,
How can I sort rows within of group by invisible filed? Please look at my example: http://jsfiddle.net/iakhmedov1/T64Kb/93
Thanks,
Igor
Hello Igor,
You cannot really sort on invisible field. However you can set one property for as a field of the column and show another in the column template.
See the example bellow for more details - sorting on first column will actually sort over the `id` field while still showing the `city` as content.
http://dojo.telerik.com/@rusev/OpaWa
Regards,Nikolay Rusev
Telerik by Progress