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

Sorting and Grouping on same column of grid

2 Answers 1701 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chau
Top achievements
Rank 1
Chau asked on 27 Apr 2018, 11:40 PM

I can't get sorting to work on a column that is selected as grouped.

https://plnkr.co/edit/j1FbSEGW3HLJDhbdHr2S?p=preview

On this grid, the group is defined on the column 'UnitPrice'.

Sorting on ProductName works, i.e. within each UnitPrice group (e.g. UnitPrice: 22, product id = 4 and 7 get sorted OK depending on asc/desc ProductName)

But Sorting on UnitPrice does not work, i.e. I expect to see the group header to show highest UnitPrice (e.g. Unit Price: 25) for descending order as first group header of the grid.

Is that feasible? Thanks!

2 Answers, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 30 Apr 2018, 02:42 PM
Hello Chau,

The Grid built-in sorting functionality when clicking the column header is to sort the items within each group by the respective field. The groups themselves can be sorted via the built-in UI Group tag when the Grid is groupable ([groupable]="true"):





https://stackblitz.com/edit/angular-fvsxha-2p21ke?file=app/app.component.ts

You can also configure the groups sorting order via the dir property of the Group descriptor.

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Chau
Top achievements
Rank 1
answered on 02 May 2018, 07:11 PM

Thanks Dimiter!  Using the built-in UI Group tag (with setting [groupable]="true") does allow sorting within group.

 

Chris
Top achievements
Rank 1
commented on 15 Dec 2021, 02:29 AM

I just wrote a blog using a custom ordering for Grouping.  You might find this useful.

https://doylestowncoder.com/2021/12/14/kendo-ui-for-angular-customizing-the-order-of-grouping-in-the-grid/

 

Tags
General Discussions
Asked by
Chau
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Chau
Top achievements
Rank 1
Share this question
or