asp .net mvc telerik grid and second header column
I use telerik grid with Ajax batch editing for MVC – works just perfect. I have to do the following – group 2 columns under common, additional to the existing header without losing editing capabilities. So technically I need just a way to put additional header line which sill span across 2 columns. I know that I can use just column template but in this way I get a columns but with read only values – code below. I will appreciate any suggestions. Thanks, Andy
<columns.Template(o => {%>
<table cellspacing="0" class="data-row">
<tr>
<td><%=o.Unit_01%></td>
<td><%=o.Value_01%></td>
</tr>
</table>
<%})
.ClientTemplate("<table cellspacing='0' calss='data-row' <tr><td><#开发者_高级运维= Unit_01 #></td><td><#= Value_01 #></td></tr></table>")
.HeaderTemplate(() => {%>
<table cellspacing="0" class="data-header">
<tr>
<td colspan="2" align="center"><strong>Period 1</strong></td>
</tr>
<tr>
<td>Unit</td>
<td>Value</td>
</tr>
</table>
<%})
.Width(200);
Never mind, got it from telerik support, code below just for the record, has some limitation but in general works for me quite well.
columns.Bound(o => o.Unit_01).Width(49).HeaderHtmlAttributes(new { style="padding:0", colspan = 2 }) // make the column span
.HeaderTemplate(() => {
%>
<div style="text-align:center" class="t-header t-last">
<strong>Period 1</strong>
</div>
<div>
<div class="t-header" style="float:left;width:49px;border-bottom: none">Unit</div>
<div class="t-header t-last">Value</div>
</div>
<%
}
);
精彩评论