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

Add ClientGroupHeaderTemplate without showing column

1 Answer 40 Views
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
0
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 :)

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