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

How to hide the parent group header in case of multi column groupings in a Kendogrid

4 Answers 1217 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Feroz
Top achievements
Rank 1
Feroz asked on 18 Jun 2013, 08:53 PM
Hi,
If I have grouped my kendogrid by multiple columns, Can I hide the header for the first column and display only the second header? Right now, after grouping by two columns, we have two headers. I can get the details of the first groupby and display in the headertemplate of the second grouping.. So, want to do away with the header created by the first grouping.
As shown in the screenshot, I want to retain the header encircled in GREEN and do away with the one in red. I would still want the grouping but just don't want the header.

4 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 20 Jun 2013, 03:11 PM
Hello Feroz,

I have already replied to the same questions in you other forum thread, however I am pasting my reply here too so the other users who are interested in the same can read it: 

Generally speaking you could achieve this using the suggested approach in my previous replies, however you should use custom logic to find the
 correct grouping rows. As a possible approach I can suggest the following:

  • Find the first group field (using dataSource' group() method):       
    //get reference to the Grid's widget
    var grid = $("#grid").data("kendoGrid");
    //get the first group field
    var firstGroup = grid.dataSource.group()[0].field;
  • Get the first group field's title from the grid.options.columns array;
  • Check if the grouping row contains the particular title and if yes remove this row. As an example: 
    $('#grid tbody .k-grouping-row:contains("City")').hide();  //City is the first group column's title

Regards,
Iliana Nikolova
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Will
Top achievements
Rank 1
answered on 12 Nov 2015, 05:51 PM
How about a link to the other thread?
0
Iliana Dyankova
Telerik team
answered on 16 Nov 2015, 11:13 AM
Hi Will,

Here is a direct link to the other thread, you could read my answer in the current thread too.

Regards,
Iliana Nikolova
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Will
Top achievements
Rank 1
answered on 16 Nov 2015, 12:30 PM
Thanks Iliana.  Sometimes it is helpful to see the full discussion.
Tags
Grid
Asked by
Feroz
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Will
Top achievements
Rank 1
Share this question
or