Hi
I want to load the initial first page of a grid using the first page of data bound from a server side collection. Subsequent page changes should be loaded using ajax.
My problem is how to set the total records of the collection to a number so that the correct number of pages are displayed.
So in the example below, Model.Calls may only contain 20 records, but the full collection count could be 100. How can I tell the grid there are in fact 100 records, not 20?
@(Html.Kendo().Grid<CallsViewData>(Model.Calls)
.Name("CallsGrid")
.Columns(c => {
c.Bound(m => m.TestResultId).Groupable(false).Title(@Html.Resource("HeadTestResultId"));
c.Bound(m => m.RunType).Title(@Html.Resource("HeadType"));
c.Bound(m => m.CallFlow).Title(@Html.Resource("HeadDirection"));
c.Bound(m => m.PhoneNo).Title(@Html.Resource("HeadCalledNo"));
c.Bound(m => m.ActualStart).Title(@Html.Resource("HeadStartDate"));
c.Bound(m => m.Connected).Title(@Html.Resource("HeadConnectedDate"));
c.Bound(m => m.Disconnected).Title(@Html.Resource("HeadDisconnectedDate"));
c.Bound(m => m.Duration).Title(@Html.Resource("HeadDuration"));
c.Bound(m => m.Duration).Title(@Html.Resource("HeadMinutes"));
})
.Resizable(s => s.Columns(true))
.Pageable()
.DataSource(ds => ds.Server().Total(100))
.BindTo(Model.Calls)
.Sortable()
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("calls", "report").Data("tt").Type(HttpVerbs.Post ))
.PageSize(20)
))
I want to load the initial first page of a grid using the first page of data bound from a server side collection. Subsequent page changes should be loaded using ajax.
My problem is how to set the total records of the collection to a number so that the correct number of pages are displayed.
So in the example below, Model.Calls may only contain 20 records, but the full collection count could be 100. How can I tell the grid there are in fact 100 records, not 20?
@(Html.Kendo().Grid<CallsViewData>(Model.Calls)
.Name("CallsGrid")
.Columns(c => {
c.Bound(m => m.TestResultId).Groupable(false).Title(@Html.Resource("HeadTestResultId"));
c.Bound(m => m.RunType).Title(@Html.Resource("HeadType"));
c.Bound(m => m.CallFlow).Title(@Html.Resource("HeadDirection"));
c.Bound(m => m.PhoneNo).Title(@Html.Resource("HeadCalledNo"));
c.Bound(m => m.ActualStart).Title(@Html.Resource("HeadStartDate"));
c.Bound(m => m.Connected).Title(@Html.Resource("HeadConnectedDate"));
c.Bound(m => m.Disconnected).Title(@Html.Resource("HeadDisconnectedDate"));
c.Bound(m => m.Duration).Title(@Html.Resource("HeadDuration"));
c.Bound(m => m.Duration).Title(@Html.Resource("HeadMinutes"));
})
.Resizable(s => s.Columns(true))
.Pageable()
.DataSource(ds => ds.Server().Total(100))
.BindTo(Model.Calls)
.Sortable()
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("calls", "report").Data("tt").Type(HttpVerbs.Post ))
.PageSize(20)
))