We have a layout that requires column headers which sit under other column headers. Since each child column has a numeric value we would like to put a total under the parent value that is the total of the children values. Is there a way to insert the total value of all childrent columns with a hierarchy dropdown or with a row before the child value?
Code looks like this:
@(Html.Kendo().Grid<DST.Areas.WSDashboard.Models.CustomWidgetsModel.GridViewModel>()
.Name("Grid")
.HtmlAttributes(new { style = "height: 450px;" })
.Scrollable(s => s.Height("100%"))
.Sortable()
.Resizable(resizable => resizable.Columns(true))
.Pageable(pageable => pageable
.Refresh(true)
.Enabled(true)
.Messages(msg => msg.Display("{0:n0} - {1:n0} of {2:n0} items"))
.PageSizes(true))
.Navigatable()
.Columns(columns =>
{
columns.Bound(p => p.KPP).Title("KPP").Width(100);
columns.Bound(p => p.SystReqValue).Title("System Requirement").Width(150);
columns.Group(group => group.Title("G Sub-Systems")
.Columns(sub => {
sub.Group(sub1 => sub1.Title("F System")
.Columns(fs =>
{
fs.Bound(p => p.RValue).Title("R").Width(100);
fs.Bound(p => p.GValue).Title("G").Width(100);
fs.Bound(p => p.BValue).Title("B").Width(100);
}));
sub.Group(sub2 => sub2.Title("G System")
.Columns(gs =>
{
gs.Bound(p => p.WValue).Title("W").Width(100);
gs.Bound(p => p.LSystemValue).Title("L Systems").Width(100);
}));
}));
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(15)
.Read(read => read.Action("GetData", "Widgets", new RouteValueDictionary { { "area", "WSDashboard" } }))
)
)
Code looks like this:
@(Html.Kendo().Grid<DST.Areas.WSDashboard.Models.CustomWidgetsModel.GridViewModel>()
.Name("Grid")
.HtmlAttributes(new { style = "height: 450px;" })
.Scrollable(s => s.Height("100%"))
.Sortable()
.Resizable(resizable => resizable.Columns(true))
.Pageable(pageable => pageable
.Refresh(true)
.Enabled(true)
.Messages(msg => msg.Display("{0:n0} - {1:n0} of {2:n0} items"))
.PageSizes(true))
.Navigatable()
.Columns(columns =>
{
columns.Bound(p => p.KPP).Title("KPP").Width(100);
columns.Bound(p => p.SystReqValue).Title("System Requirement").Width(150);
columns.Group(group => group.Title("G Sub-Systems")
.Columns(sub => {
sub.Group(sub1 => sub1.Title("F System")
.Columns(fs =>
{
fs.Bound(p => p.RValue).Title("R").Width(100);
fs.Bound(p => p.GValue).Title("G").Width(100);
fs.Bound(p => p.BValue).Title("B").Width(100);
}));
sub.Group(sub2 => sub2.Title("G System")
.Columns(gs =>
{
gs.Bound(p => p.WValue).Title("W").Width(100);
gs.Bound(p => p.LSystemValue).Title("L Systems").Width(100);
}));
}));
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(15)
.Read(read => read.Action("GetData", "Widgets", new RouteValueDictionary { { "area", "WSDashboard" } }))
)
)