cant get the ClientFooterTemplate to show

4 posts, 1 answers
  1. James
    James avatar
    12 posts
    Member since:
    Jun 2015

    Posted 26 Apr Link to this post

    hi,

    i can get the group footer to show, but the total client footer. below is the code.  any ideas?  thanks.

     

        @(Html.Kendo().Grid<ClientReporting.ViewModels.Reports.VolumeViewModel>
            ()
            .Name("ReportGrid")
            .Columns(columns =>
            {
                columns.Bound(o => o.Firm).Width(130).Locked(true);
                columns.Bound(o => o.Collat).Width(70);
                columns.Bound(o => o.UserName).Width(100).Title("User");
                columns.Bound(o => o.Product).Title("Product Type").Width(110);
                columns.Bound(o => o.Symbol).Title("Symbol").Width(100);
                columns.Bound(o => o.Volume).Title("Amount (USD)").Width(150).Format("{0:n0}")
                        .ClientGroupFooterTemplate("Sub-total: #= kendo.toString(sum, \"n2\")#")
                        .ClientFooterTemplate("Period Total: #= kendo.toString(sum, \"n2\")#");
            })
            .ToolBar(tools => tools.Excel())
            .Excel(excel => excel
            .FileName("RevenueReport.xlsx")
            .Filterable(true)
            .AllPages(true)
            .ProxyURL(Url.Action("ExcelExportSave", "ReportGrid"))
            )
            .Sortable()
            .AllowCopy(true)
            .ColumnMenu()
            .Groupable(group => group.ShowFooter(true))
            .Resizable(resize => resize.Columns(true))
            .Scrollable(scrollable => scrollable.Virtual(true))
            .Scrollable(s => s.Height("500px"))
            .Filterable(filterable => filterable
            .Extra(true)
            .Operators(operators => operators
            .ForNumber(n => n.Clear()
            .IsEqualTo("Is Equal To")
            .IsGreaterThan("Is Greater Than")
            .IsGreaterThanOrEqualTo("Is Greater Than Or Equalt To")
            .IsLessThan("Is Less Than")
            .IsLessThanOrEqualTo("Is Less Than Or Equal To")
            )
            .ForDate(d => d.Clear()
            .IsEqualTo("Is Equal To")
            .IsGreaterThan("Is Greater Than")
            .IsGreaterThanOrEqualTo("Is Greater Than Or Equal To")
            .IsLessThan("Is Less Than")
            .IsLessThanOrEqualTo("Is Less Than Or Equal To"))
            )
            )
            .Selectable(selectable => selectable
                .Mode(GridSelectionMode.Multiple)
                .Type(GridSelectionType.Row)
            )
            .AutoBind(false)
            .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(100)
                .Model(model =>
                {
                    model.Id(p => p.Firm);
                    model.Field(p => p.Collat).Editable(false);
                    model.Field(p => p.UserName).Editable(false);
                    model.Field(p => p.Product).Editable(false);
                    model.Field(p => p.Symbol).Editable(false);
                    model.Field(p => p.Volume).Editable(false);
                })
            .Read(read => read.Action("Volume", "ReportGrid")
            .Data("GetGridData"))
            .Group(groups =>
            {
                groups.Add(model => model.Firm);
                groups.Add(model => model.Collat);
                groups.Add(model => model.UserName);
                groups.Add(model => model.Product);
                groups.Add(model => model.Symbol);
            })
            .Aggregates(aggregates =>
            {
                aggregates.Add(model => model.Volume).Sum();
            })

            .Events(events => events.Error("onError").Change("onChange"))
            ))


  2. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 28 Apr Link to this post

    Hi James,

    The provided code works as expected on my side, when I use some other data, but with your settings. I see that the Grid has AutoBind set to false. How do you trigger the data to load? Is the Grid recreated at any point? Can you provide an example or a live URL for inspection?

    Regards,
    Dimo
    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
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. James
    James avatar
    12 posts
    Member since:
    Jun 2015

    Posted 28 Apr in reply to Dimo Link to this post

    i guess lets define "as expected" first.  what i expect is to see the group sum footer - "Sub-total" after every group and then at the end of the page, with all of the groups collapsed (default) or in any other state of being open, as the last line the "Period Total" sum.  i do not see the last line, i.e. the grand total.

    the data is bound when the user hits submit after selecting a few parameters   no, the the grid is not recreated.  i can post a screenshot of what the grid looks like if needed.

    unfortunately i cant expose the url, its an internal report.

    thanks.

  5. Answer
    Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 29 Apr Link to this post

    Hi James,

    >> "what i expect is to see the group sum footer - "Sub-total" after every group and then at the end of the page, with all of the groups collapsed (default) or in any other state of being open, as the last line the "Period Total" sum."

    Yes, this is what I see on my side. Here is a screenshot and a code snippet. I have tested this in our offline ASP.NET MVC demos. Can you provide an isolated runnable example, which exhibits the unexpected behavior?

    @(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.ProductViewModel>
          ()
          .Name("ReportGrid")
          .Columns(columns =>
          {
              columns.Bound(o => o.ProductID).Width(430).Locked(true);
              columns.Bound(o => o.UnitsInStock).Title("Amount (USD)").Width(650).Format("{0:n0}")
                      .ClientGroupFooterTemplate("Sub-total: #= kendo.toString(sum, \"n2\")#")
                      .ClientFooterTemplate("Period Total: #= kendo.toString(sum, \"n2\")#");
          })
          .ToolBar(tools => tools.Excel())
          .Excel(excel => excel
          .FileName("RevenueReport.xlsx")
          .Filterable(true)
          .AllPages(true)
          .ProxyURL(Url.Action("ExcelExportSave", "ReportGrid"))
          )
          .Sortable()
          .AllowCopy(true)
          .ColumnMenu()
          .Groupable(group => group.ShowFooter(true))
          .Resizable(resize => resize.Columns(true))
          .Scrollable(scrollable => scrollable.Virtual(true))
          .Scrollable(s => s.Height("500px"))
          .Filterable(filterable => filterable
          .Extra(true)
          .Operators(operators => operators
          .ForNumber(n => n.Clear()
          .IsEqualTo("Is Equal To")
          .IsGreaterThan("Is Greater Than")
          .IsGreaterThanOrEqualTo("Is Greater Than Or Equalt To")
          .IsLessThan("Is Less Than")
          .IsLessThanOrEqualTo("Is Less Than Or Equal To")
          )
          .ForDate(d => d.Clear()
          .IsEqualTo("Is Equal To")
          .IsGreaterThan("Is Greater Than")
          .IsGreaterThanOrEqualTo("Is Greater Than Or Equal To")
          .IsLessThan("Is Less Than")
          .IsLessThanOrEqualTo("Is Less Than Or Equal To"))
          )
          )
          .Selectable(selectable => selectable
              .Mode(GridSelectionMode.Multiple)
              .Type(GridSelectionType.Row)
          )
          .DataSource(dataSource => dataSource
              .Ajax()
              .PageSize(100)
              .Model(model =>
              {
                  model.Id(p => p.ProductID);
                  model.Field(p => p.UnitsInStock).Editable(false);
              })
          .Read(read => read.Action("Aggregates_Read", "Grid"))
          .Group(groups =>
          {
              groups.Add(model => model.CategoryID);
          })
          .Aggregates(aggregates =>
          {
              aggregates.Add(model => model.UnitsInStock).Sum();
          })
     
          ))


    Regards,
    Dimo
    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
Back to Top
UI for ASP.NET MVC is VS 2017 Ready