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

Group BY option removing DataBound activity set in KendoGrid

8 Answers 264 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mansoor
Top achievements
Rank 1
Mansoor asked on 10 Jul 2014, 07:38 AM
Hi All

I have a problem with Grouping .When i do a GroupBy one of the column the Disable class set during databound is lost and everything is enabled once again.

Please find the fiddle link.

http://jsfiddle.net/Mans/zCNXM/5/

8 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 14 Jul 2014, 06:43 AM
Hello Mansoor,

I don't see any `Disable class` in the fiddle. Can you please explain a bit?

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
Mansoor
Top achievements
Rank 1
answered on 14 Jul 2014, 07:28 AM
Hi Nikolay 

The 2nd row in the grid is disabled or say not selectable by adding a criteria on the DataBound event .

So now when the grid data is loaded and I do a Group By FirstName or LastName or any other column you could see that the class set in the Databound event  gets enabled and now the 2nd row gets option to Select or say enabled.
 
I wanted the 2nd row to be disabled always after once  being set the DataBound event and later on when I do a Group by also it should retain as it is.

Thanks
Mansoor


0
Nikolay Rusev
Telerik team
answered on 15 Jul 2014, 08:24 AM
Hello Mansoor,

This is because when you group and serverGrouping is false (as by default and in your case) the view() method returns the grouped items. You will have to flatten those items in order to have the reset of your code working.

Here is one way to implement this: http://jsfiddle.net/Ne9pD/.

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
Mansoor
Top achievements
Rank 1
answered on 16 Jul 2014, 07:02 AM
Hi Nikolay

Thanks for the reply.This is working but the order in the grid is getting changed when i do a group by any column other than IsEdit.I expect it to behave the same way for all the columns.ie: The grid should be doing group by column without changing the order.Currently in the fiddle after i do a grouping the second row comes on top and acts like 1st row.

Can something be done on this.

Thanks in advance
0
Nikolay Rusev
Telerik team
answered on 17 Jul 2014, 11:36 AM
Hello Mansoor,

This seems to be a bug in the version that you are using. If you update to more recent version of Kendo UI scripts all should be working correct. 

Here is the updated example to the latest Q2 2014 version: http://jsfiddle.net/j7cvN/. Notice that data bound event handler is also changed slightly. Instead of using the `id` of the model and data attribute it is using `uid`.

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
Mansoor
Top achievements
Rank 1
answered on 18 Jul 2014, 07:40 AM
Hi Nikolay

Thanks it seems to be working fine when i do not do a default grouping and have an field hidden then the hidden column is turning up.

Please find the updated fiddle http://jsfiddle.net/j7cvN/1/

I have done group by firstname and also hidden the field IsEdit and when it loads for the first time you could see the rows that have been grayed out have IsEdit column value turning up.

Note: When i remove grouping after the first load and do a group by firstname the behavior remains as expected.

This happens only for the 1st load.

Thanks in advance


0
Mansoor
Top achievements
Rank 1
answered on 18 Jul 2014, 07:53 AM
Hi Nikolay

Please find the fiddle link http://jsfiddle.net/j7cvN/2/

I have added a default grouping by FirstName and also hidden the field IsEdit.

1) The first time load gives me the ISEdit field for the rows that have been greyed out.
2) Column Reorder does not function properly .It reorders only the enabled row values but not the greyed rows.



Thanks in advance.
0
Nikolay Rusev
Telerik team
answered on 21 Jul 2014, 12:25 PM
Hello Mansoor,

Indeed this behavior is expected due to the following reason - `.k-group-cell` class name is  used as a marker which cells are group cells. This is important for few features like column hiding ( to skip the cells with this class name), column reordering (to not allow reordering of the system group cells). 

That said the implementation so far will only work for the basing scenario whiteout hiding columns or reorder them.

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