We have a page that contains a mvc kendo grid. This grid contains a detail template = all working as expected!
Also, on the same page there is a checkbox.
In our grid (below), and we want to switch SALES OUT and COST VALUE column groupings based on the checkbox being checked. Does the checkbox have to be a html checkbox or can we leave it as a .net checkbox and do this in the code behind?
I'm new to kendo so any help greatly appreciated. We are trialling it to see if ti fits our requirements.
Thanks Simon
@(Html.Kendo().Grid<
Web_AllPFCs_BySMR_v5
>()
.Name("wpsbysmr")
.Columns(columns =>
{
columns.Bound(c => c.SMRCat).Title("Category").Width(150);
columns.Group(g => g.Title("Sales Out").Visible(true)
.Columns(costvalue =>
{
costvalue.Bound(c => c.Avg1_Invoice).Width(100).Title("PPU Calendar YTD").Format("{0:£#,##0}");
costvalue.Bound(c => c.Avg2_Invoice).Width(100).Title("PPU Calendar PYTD").Format("{0:£#,##0}");
costvalue.Bound(c => c.Value1).Width(100).Title("Calendar YTD").Format("{0:£#,##0}");
costvalue.Bound(c => c.Value2).Width(100).Title("Calendar PYTD").Format("{0:£#,##0}");
costvalue.Bound(c => c.PFCDiffSale).Width(100).Title("Change").Format("{0:£#,##0}");
costvalue.Bound(c => c.PFCPercSale).Width(100).Title("Change %").Format("{0:0.0%}");
})
);
columns.Group(g => g.Title("Cost Value").Visible(false)
.Columns(costvalue =>
{
costvalue.Bound(c => c.Avg1_Cost).Width(100).Title("PPU Calendar YTD").Format("{0:£#,##0}");
costvalue.Bound(c => c.Avg2_Cost).Width(100).Title("PPU Calendar PYTD").Format("{0:£#,##0}");
costvalue.Bound(c => c.Cost1).Width(100).Title("Calendar YTD").Format("{0:£#,##0}");
costvalue.Bound(c => c.Cost2).Width(100).Title("Calendar PYTD").Format("{0:£#,##0}");
costvalue.Bound(c => c.PFCDiffCost).Width(100).Title("Change").Format("{0:£#,##0}");
costvalue.Bound(c => c.PFCPercCost).Width(100).Title("Change %").Format("{0:0.0%}");
})
);
})
.Scrollable(s => s.Height("auto"))
.HtmlAttributes(new { style = "max-height:550px !important;" })
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(15))
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("WPSBySMR", "Home"))
.PageSize(10)
)
.Events(e => e.DataBound("wpsbysmr_Databound"))
.ClientDetailTemplateId("SMRCatDetails")
)