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

Skip a group if there's no value in a group field

1 Answer 32 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 28 Nov 2016, 01:05 PM
Hello,


Is it possible to skip a group template if there's no value in a group field?

For example, I want to group on category and sub-category and I want to display data in the following way:

- Category: 'Automative'

--Sub-category: 'Cars'

----Ferrari

----Lamborghini

--Sub-category: 'Tyres'

---Bridgestone

----Michelin

-Category: 'Bikes'

-- Peugeot

-- Trek




The products in the 'Bikes' category don't have a sub-category - they belong straight to the top category. Unfortunately, if I do grouping on both 'category' and 'sub-category', Kendo UI Grid will add an empty grouping template for the missing sub-category.


Is it somehow possible to skip a group template, if there's no value in a group column?

I've tried using a function for `groupHeaderTemplate`, but unfortunately, it can only put an empty values in a template, it cannot skip the whole group template.

Thanks,

Mike

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 30 Nov 2016, 08:53 AM
Hi Mike,

The same question has been answered in the other support thread, but I will paste the answer here, so others can benefit as well:

I'm afraid that such functionality is not supported - a group header will be created for each group value.

However, if you want to show hierarchical data maybe the TreeList widget will more appropriate in this case.

If you need further assistance on the same case, please choose only one of the threads to continue the communication in, in order to avoid duplicate threads. Thank you in advance.

Regards,
Dimiter Topalov
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or