Pager error in Kendo Grid(Nan-Nan of 1 items)
You need to define the pageSize in the grid data source. Not in the success function.
In your case you only need to include in your data source the following:
$.ajax({
url: '../Student/GetStudentDetails?StudentId=' + Data.StudentId,
type: 'POST',
contentType: 'application/json',
dataType: 'json',
pageSize: 10,
success: function (data) {...
I hope this helps. More information at: Sudarsan Dash'blogs
I made it work like below: specifying the pagesize inside the datasource fixed my problem (Nan-Nan of 1 items)
< script type = "text/javascript" >
$(document).ready(function() {
var modelData = @Html.Raw(Json.Encode(Model));
$("#grid").kendoGrid({
reorderable: true,
pageable: {
input: true,
numeric: false
},
scrollable: true,
sortable: true,
dataSource: {
data: modelData,
pageSize: 10 // specifying the pagesize inside the datasource fixed my problem (Nan-Nan of 1 items)
},
columns: [{
field: "fieldparameter",
title: "titleparameter",
filterable: true,
sortable: true
}]
});
}); < /script>
This is what you need to resolve the issue. Works like a dream!
<script>
$(document).ready(function () {
$("#grid").kendoGrid({
dataSource: {
pageSize: 10
},
});
});
</script>