I have a scrolable, pageable grid which I add to MVC view via html kendo helper with selectable page size
@(Html.Kendo().Grid(Model.AvailableEmployees).Name("EmployeeGrid").Columns(cols =>
{
cols.Bound(...).
ClientTemplate("<input type=\"checkbox\" class=\"check_select\" data-id='#= data.ID #' />").
HeaderTemplate("<input type=\"checkbox\" id=\"headerCheck\" />").Sortable(false).Filterable(false).Width(50);
cols.Bound(...).HeaderTemplate(...).Width(150);
...
})
.HtmlAttributes(new { style = "width:90%;" })
.Pageable(
pager => pager.PageSizes(new int[] { 20, 50, 100 })
)
.Sortable()
.Filterable()
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
)
.Selectable
(selectable => selectable.Mode(GridSelectionMode.Multiple)))
However, when the grid renders it always displays 10(???) users per page on initial render. And chages it to correct number once you start changing the options on the page size dropdown. How to make it display the correct number on the first render?
@(Html.Kendo().Grid(Model.AvailableEmployees).Name("EmployeeGrid").Columns(cols =>
{
cols.Bound(...).
ClientTemplate("<input type=\"checkbox\" class=\"check_select\" data-id='#= data.ID #' />").
HeaderTemplate("<input type=\"checkbox\" id=\"headerCheck\" />").Sortable(false).Filterable(false).Width(50);
cols.Bound(...).HeaderTemplate(...).Width(150);
...
})
.HtmlAttributes(new { style = "width:90%;" })
.Pageable(
pager => pager.PageSizes(new int[] { 20, 50, 100 })
)
.Sortable()
.Filterable()
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
)
.Selectable
(selectable => selectable.Mode(GridSelectionMode.Multiple)))
However, when the grid renders it always displays 10(???) users per page on initial render. And chages it to correct number once you start changing the options on the page size dropdown. How to make it display the correct number on the first render?