How to cover a column heading over 2 columns using a Kendo UI grid wrapper?

Using MVC Wrapper for a Kendo grid, How can I get the column headings of column 2 column?

I have 4 columns and want a heading on the first and third columns spanning col1 and col2, and one on col 3 spanning col 3 and 4.

when i do this with

.HeaderHtmlAttributes(new { Colspan = 2 }) 

it works, but there are always 4 headers, not only 2 ...

+4
source share
1 answer

You can add .HeaderHtmlAttributes(new { style= "display:none;" }) in the following column:

 @(Html.Kendo().Grid(Model.List) .Name("grid") .Columns(c => { c.Bound(e => e.ID); c.Bound(e => e.Nom).HeaderHtmlAttributes(new { colspan = 2 }); c.Bound(e => e.Nb).HeaderHtmlAttributes(new { style= "display:none;" }); }) ) 
+10
source

All Articles