I am trying to add a sum aggregate in the HTML helper for the grid, but am not sure how to add it for the Total field in this example. This is my simple example:
@(Html.Kendo().Grid(Model).Name("Grid")
.Pageable()
.Sortable()
.Scrollable()
.Filterable()
.Columns(columns =>
{
columns.Bound(p => p.FirstName);
columns.Bound(p => p.LastName);
columns.Bound(p => p.Email);
columns.Bound(p => p.Total).ClientFooterTemplate("Sum: $#= sum #");
})
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("Users_Read", "Home"))
))
This should work
.FooterTemplate(@<text>Total Count: @item.Sum</text>)
You are not defining the
aggregate
in theDataSource
: