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

How to group only when the field has a value

1 Answer 512 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 17 Dec 2015, 08:49 PM

The first TASK column will always have a value in every row. The second DEPARTMENT column will have some rows with a value. I would like to hide the DEPARTMENT grouping when there are no values within the first grouping of TASK.

I only best explain this visually.

The angular material looking tables are the grids where its grouping by DEPARTMENT even when there is data. 

 The tiny table with green rows is my very old school way of doing grouping. As you can see the last TASK row has 1 department grouping, whereas the other Task groups did not group by department because there is no department.

How do I accomplish this in Kendo Grid.I have search the forums and didn't find anything that lead me to a fix or hack. Your help is greatly appreciated. 

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 18 Dec 2015, 02:10 PM
Hi Jeff,

By default the grouping is performed on all items based on the value of the group by field. Excluding some records from this is not available.

However, you can define a template for the group item and display custom text when the value in the field is null. Check out the dojo below that outlines the approach,



Regards,
Viktor Tachev
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
Jeff
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or