Grid Custom Server Binding Data
Group statistics have no data ,ClientGroupHeaderTemplate() do not work;
GroupHeaderTemplate(g=>g.Count),g.Count is Null
Custom Server Binding the way How to implement group statistics?
Examples Code:
@model System.Collections.IEnumerable@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.Order>()
.Name("Grid")
.EnableCustomBinding(true)
.BindTo(Model)
.Columns(columns => {
columns.Bound(o => o.OrderID).Groupable(false);
columns.Bound(o => o.ShipCity).GroupHeaderTemplate(g=>g.Count);
columns.Bound(o => o.ShipCountry).ClientGroupHeaderTemplate("ShipCountry: #= value # (Count: #= count#)");
columns.Bound(o => o.ShipName);
})
.Pageable()
.Sortable()
.Filterable()
.Scrollable()
.Groupable()
.DataSource(dataSource =>dataSource
.Server()
.Total((int)ViewData["total"])
.Aggregates(aggregates =>
{
aggregates.Add(p => p.ShipCountry).Count();
}
)
)
)