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

Add ClientGroupHeaderTemplate without showing column

1 Answer 261 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nils
Top achievements
Rank 1
Veteran
Iron
Nils asked on 01 Jul 2020, 03:02 PM

Hey everyone,

I'm trying to create a small grid for "articles" which is grouped by "articleGroup".
Now the plan is to change the ClientGroupHeaderTemplate, to add a checkbox to check all sub elements, for the group without showing it as a column in the grid.

I can set the grouping in the dataSource, but I struggle to add the checkbox to the group header without adding it as a column.

 

Html.Kendo().Grid<ArticleViewModel>()
                   .Name("articleGrid")
                   .Columns(c =>
                   {
                       c.Select().Width(50);
                       c.Bound(x => x.ArticleNo);
                   })
                   .DataSource(dataSource => dataSource
                                   .Ajax()
                                   .PageSize(50)
                                   .GroupPaging(true)
                                   .Group(x => x.Add(y => y.ArticleGroup))
                                   .Read("GridRead_Whitelist", "Plot"))

 

Best regards

Nils

1 Answer, 1 is accepted

Sort by
2
Nils
Top achievements
Rank 1
Veteran
Iron
answered on 01 Jul 2020, 03:08 PM

Okay, my bad 😐

Just 2 min after I posted this and searched for over 2 Hours, I found the solution.

Just add it as column "c.Bound(x => x.ArticleGroup).ClientGroupHeaderTemplate("XXX").Hidden(true);" and set Hidden to true. I had only seen the Visible flag before which removed the template aswell. It works like a charm now :)

Vinayak
Top achievements
Rank 1
commented on 16 Aug 2021, 06:55 AM

Thank you.

Worked for me.

rajnesh
Top achievements
Rank 1
commented on 04 Nov 2022, 09:32 AM

Can someone please answer how we can do same in angular ?
Ivan Danchev
Telerik team
commented on 08 Nov 2022, 07:13 AM

Rajnesh,

We have a separate forum for Kendo UI for Angular, so we would suggest opening a new thread there: https://www.telerik.com/forums/kendo-angular-ui

 

Tags
Grid
Asked by
Nils
Top achievements
Rank 1
Veteran
Iron
Answers by
Nils
Top achievements
Rank 1
Veteran
Iron
Share this question
or