Hi There,
I am currently working on Kendo Grid. I have implemented ajax binding with default paging using the below link
http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/ajax-binding
In ie10 i am getting a javascript error in aspnetmvc.min.js file before the pageload. once page loaded everything is working perfectly.
below is the code i have used.
I am using Kendo.MVC.dll and KendoAjaxBinding.Model.dll of version v4.0.30319
.cshtml
--------
<div>
@(Html.Kendo().Grid<KendoUIAjaxBinding.Model.PM_ANO>()
.Name("grid")
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("Products_Read", "Home")
.Data("productsReadData")
)
)
.Columns(columns =>
{
columns.Bound(anomaly => anomaly.GOD);
columns.Bound(anomaly => anomaly.VER);
// Create a column bound to the ProductID property
columns.Bound(anomaly => anomaly.C_ANO);
// Create a column bound to the ProductName property
columns.Bound(anomaly => anomaly.Y_ANO);
// Create a column bound to the UnitsInStock property
columns.Bound(anomaly => anomaly.Z_REP_AUTO);
})
.Pageable(x => x.PageSizes(true)) // Enable paging
.Sortable() // Enable sorting
)
</div>
in Layout page i have rendered like this
----------------------------------------
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title - My ASP.NET MVC Application</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
<script src="~/Scripts/jquery-1.7.1.js"></script>
<script src="~/Scripts/Kendo/kendo.web.min.js"></script>
<script src="~/Scripts/Kendo/kendo.aspnetmvc.min.js"></script>
</head>
controller code
------------------
public JsonResult
Products_Read([DataSourceRequest]DataSourceRequest request, string firstName, string lastName)
{
var _context = new E2A_GUIEntities();
IQueryable<PM_ANO> anomaly = _context.PM_ANO;
var total = anomaly.Count();
if (request.Page > 0)
{
anomaly = anomaly.OrderBy(a => a.C_ANO).Skip((request.Page - 1) * request.PageSize);
}
anomaly = anomaly.Take(request.PageSize);
var result = new DataSourceResult()
{
Data = anomaly, // Process data (paging and sorting applied)
Total = total // Total number of records
};
return Json(result, JsonRequestBehavior.AllowGet);
}
Please help me in resolving this.
Thanks and Regards,
Gangadhar.
I am currently working on Kendo Grid. I have implemented ajax binding with default paging using the below link
http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/ajax-binding
In ie10 i am getting a javascript error in aspnetmvc.min.js file before the pageload. once page loaded everything is working perfectly.
below is the code i have used.
I am using Kendo.MVC.dll and KendoAjaxBinding.Model.dll of version v4.0.30319
.cshtml
--------
<div>
@(Html.Kendo().Grid<KendoUIAjaxBinding.Model.PM_ANO>()
.Name("grid")
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("Products_Read", "Home")
.Data("productsReadData")
)
)
.Columns(columns =>
{
columns.Bound(anomaly => anomaly.GOD);
columns.Bound(anomaly => anomaly.VER);
// Create a column bound to the ProductID property
columns.Bound(anomaly => anomaly.C_ANO);
// Create a column bound to the ProductName property
columns.Bound(anomaly => anomaly.Y_ANO);
// Create a column bound to the UnitsInStock property
columns.Bound(anomaly => anomaly.Z_REP_AUTO);
})
.Pageable(x => x.PageSizes(true)) // Enable paging
.Sortable() // Enable sorting
)
</div>
in Layout page i have rendered like this
----------------------------------------
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title - My ASP.NET MVC Application</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
<script src="~/Scripts/jquery-1.7.1.js"></script>
<script src="~/Scripts/Kendo/kendo.web.min.js"></script>
<script src="~/Scripts/Kendo/kendo.aspnetmvc.min.js"></script>
</head>
controller code
------------------
public JsonResult
Products_Read([DataSourceRequest]DataSourceRequest request, string firstName, string lastName)
{
var _context = new E2A_GUIEntities();
IQueryable<PM_ANO> anomaly = _context.PM_ANO;
var total = anomaly.Count();
if (request.Page > 0)
{
anomaly = anomaly.OrderBy(a => a.C_ANO).Skip((request.Page - 1) * request.PageSize);
}
anomaly = anomaly.Take(request.PageSize);
var result = new DataSourceResult()
{
Data = anomaly, // Process data (paging and sorting applied)
Total = total // Total number of records
};
return Json(result, JsonRequestBehavior.AllowGet);
}
Please help me in resolving this.
Thanks and Regards,
Gangadhar.