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

custom aggregates

1 Answer 760 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Maurice
Top achievements
Rank 1
Veteran
Maurice asked on 25 May 2016, 02:22 PM

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
        .Ajax()
        .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

 

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 26 May 2016, 02:39 PM
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.



Regards,
Viktor Tachev
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
Maurice
Top achievements
Rank 1
Veteran
Answers by
Viktor Tachev
Telerik team
Share this question
or