This example shows how to use aggregates in Telerik Grid for ASP.NET MVC which is ajax-bound.
The following aggregates are supported:
To specify the aggregates for a column use the Aggregates method:
columns.Bound(o => o.UnitsInStock)
.Aggregate(aggregates => aggregates.Count().Min().Max())
Aggregate results can be displayed in three locations:
columns.Bound(o => o.UnitsInStock)
.Aggregate(aggregates => aggregates.Count())
.ClientGroupHeaderTemplate("<#= Title #>: <#= Key #> (Count: <#= Count #>)");
columns.Bound(o => o.UnitsOnOrder)
.Aggregate(aggregates => aggregates.Average())
.ClientGroupFooterTemplate("Average: <#= Average #>");
columns.Bound(o => o.UnitsInStock)
.Aggregate(aggregates => aggregates.Count().Min().Max())
.ClientFooterTemplate(
"<div>Min: <#= Min #></div>" +
"<div>Max: <#= Max #></div>"
);