custom aggregates

2 posts, 0 answers
  1. Maurice
    Maurice avatar
    9 posts
    Member since:
    Jan 2016

    Posted 25 May Link to this post

    I have a mvc grid with as model { int projectnumber, int Monday }

    and code

    columns.Bound(c => c.Monday).Title(text: "Monday").ClientFooterTemplate(template: "#=sum#");

    .DataSource(datasource => datasource
            .Aggregates(aggregates =>
                aggregates.Add(a => a.Monday).Sum();

    Now I only want to create the sum over all lines in the grid with exception of the line with project number 1.


    The AJAX read gets back [1,1] and [2,4] and [3,5] So I hope to get a sum of 4+5=9 instead of the 10 I get with a normal sum.


    I hope myu question is clear and somebody knows how to do a partial sum.


    With kind regards,

    Maurice Lucas


  2. Viktor Tachev
    Viktor Tachev avatar
    1438 posts

    Posted 26 May Link to this post

    Hello Maurice,

    In order to implement the behavior you can use a JavaScript function to calculate the custom aggregates. Check out the following threads that discuss how this can be implemented.

    Viktor Tachev
    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 AJAX banner
Back to Top