I know this has been asked multiple times, but i still cannot set the initial page of Kendo Grid
@(Html.Kendo().Grid<
TherapistViewModel
>()
.Name("KendoTherapistGrid")
.AutoBind(false)
.Columns(columns =>
{
---BOUND COLUMNS---
})
.Events(e=>e.DataBound("onRowBound"))
.Pageable(pageable => pageable.Refresh(true).PageSizes(true).ButtonCount(5))
.Filterable()
.Sortable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Model(model => model.Id(p => p.TherapistId))
.Read(read => read.Action("GetTherapistdata", "Therapist").Data("PatientDetails")) ) )
Since AutoBind if false, I am calling ReadDataSource when the document is ready
$(document).ready(function () {
ReadDataSource();
});
function ReadDataSource()
{
$("#KendoTherapistGrid").data().kendoGrid.dataSource.page(2);
}
I am hard-coding the page number for now until I get can it to work. There are three pages in the grid.