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

[Solved] Change grouping based on data

1 Answer 140 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Christopher
Top achievements
Rank 1
Christopher asked on 02 Mar 2015, 11:28 PM
I have a grid with several columns, and I want to group the data.  I want the grouping to be based on certain aspects of the returned data.  The problem is that grouping is determined by the options of the DataSource, and it seems that once I request data and get results, changing the options of the DataSource has no effect. 

What I'm trying to do is this:
For the first four columns of the grid, if there is only one distinct item in that column, then do not group by that column.  If there are more than one distinct item in that column, do group by that column. 

I have tried reading the data, then changing the datasource options, then refreshing the grid, but the grid still renders with default grouping. 

Any tips/ideas? 

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 04 Mar 2015, 01:44 PM

Hello Christopher,

You can only change the groups by defining new group descriptors and apply them through the DataSource.group method.

Regards,
Nikolay Rusev
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
Christopher
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or