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

Groupping and sorting in kendo Grid

6 Answers 373 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Safa
Top achievements
Rank 1
Safa asked on 06 May 2016, 08:50 AM

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

Sort by
0
Nikolay Rusev
Telerik team
answered on 10 May 2016, 06:38 AM

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
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Safa
Top achievements
Rank 1
answered on 02 Jun 2016, 02:10 PM

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.

 

 

0
Alex Hajigeorgieva
Telerik team
answered on 06 Jun 2016, 01:22 PM

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:

http://dojo.telerik.com/EwonI

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
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Igor
Top achievements
Rank 1
answered on 25 Oct 2016, 03:56 PM

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

0
Igor
Top achievements
Rank 1
answered on 25 Oct 2016, 03:57 PM

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

0
Nikolay Rusev
Telerik team
answered on 27 Oct 2016, 07:55 AM

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
 
Build rich, delightful, *native* Angular 2 apps with Kendo UI for Angular 2. Try it out today! Kendo UI for Angular 2 (currently in beta) is a jQuery-free toolset, written in TypeScript, designed from the ground up to offer true, native Angular 2 components.
 
Tags
Grid
Asked by
Safa
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Safa
Top achievements
Rank 1
Alex Hajigeorgieva
Telerik team
Igor
Top achievements
Rank 1
Share this question
or