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

Multiple Column Header Hierarchy

1 Answer 165 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 11 Apr 2016, 09:41 PM
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" } }))
        )
    ) 

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 13 Apr 2016, 11:28 AM
Hello Justin,

I am not sure that I understand the exact requirement that you have, but I could suggest that you take a look at our "Aggregates" demo and see if this is what you are looking for:
If your requirement could not be achieved with the aggregates, please provide some mock-up or screenshot of the final result that you are aiming for.


Regards,
Konstantin Dikov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Justin
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or