aggregate sum not refreshing on grid save event refresh

2 posts, 0 answers
  1. Adam King
    Adam King avatar
    32 posts
    Member since:
    May 2010

    Posted 07 Dec 2016 Link to this post

    My grid has 2 aggregate Sum()  columns which display and work properly - except for when the user updates the grid amount I want the sum to dynamically update when users tab out of the cell they're editing.

    I have tried a myGrid.refresh() on the grid Save event and on the grid datasource Change event. I believe its refreshing the grid but not the sums.

     

    The aggregate is added with this code:

      .Aggregates(aggregates =>
              {
                  aggregates.Add(expense => expense.allowedamt).Sum();
                  aggregates.Add(expense => expense.expenseamt).Sum();
              }

     

    and the column and clientFooterTemplates are added with this code:

    columns.Bound(expense => expense.expenseamt).HtmlAttributes(new { style = "text-align:right;" }).HeaderHtmlAttributes(new { style = "text-align:right;" }).Width(50)
                .ClientFooterTemplate("#= kendo.toString(sum, 'C') #").FooterHtmlAttributes(new { style = "text-align:right;" });
              columns.Bound(expense => expense.allowedamt).HtmlAttributes(new { style = "text-align:right;" }).HeaderHtmlAttributes(new { style = "text-align:right;" }).Width(50)
                .ClientFooterTemplate("#= kendo.toString(sum, 'C') #").FooterHtmlAttributes(new { style = "text-align:right;" });

     

    Any ideas how to get the Grid summary row values to dynamically update ?

  2. Kostadin
    Admin
    Kostadin avatar
    1733 posts

    Posted 09 Dec 2016 Link to this post

    Hi Adam,

    I would recommend you to examine the following forum thread where the same question is already discussed. Please give this suggestion a try and let me know about the result.

    I am looking forward to your reply.

    Regards,
    Kostadin
    Telerik by Progress
    Telerik UI for ASP.NET MVC is ready for Visual Studio 2017 RC! Learn more.
Back to Top