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

sorting the group programmatically

1 Answer 347 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gaetano
Top achievements
Rank 1
Gaetano asked on 09 Jul 2013, 10:01 AM
Hello,

I need to sort the groups of a grid (and not the rows in the groups) programmatically.
I've seen that there's this functionality by clicking (after a grouping action) on the groupIndicator in the groupBar.

There's some function that i can call to use that functionality? Or some workaround?

Thanks

Fabio

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 11 Jul 2013, 08:36 AM
Hello Fabio,

In order to achieve this you could change group direction. For example:

//get reference to the Grid widget
var grid = $("#grid").data("kendoGrid");
//set asc direction to the group (for example grouped by FirstName)
grid.dataSource.group({field:"FirstName", dir: "asc" });
//set desc direction to the group (for example grouped by FirstName)
grid.dataSource.group({field:"FirstName", dir: "desc" });
  Regards,
Iliana Nikolova
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Gaetano
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or