This is a migrated thread and some comments may be shown as answers.

How to set initial page of Kendo Grid

0 Answers 220 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Trey
Top achievements
Rank 2
Trey asked on 24 Apr 2018, 07:55 PM

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.

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Trey
Top achievements
Rank 2
Share this question
or