I am try to bind data to a list view (http://demos.kendoui.com/web/listview/index.html) from result of asp.net mvc controller method.
What is the way we can attach the model data or Controller data to the kendo datasource?
Below code does not work.
--MVC Controller Method returning Products results set.
What is the way we can attach the model data or Controller data to the kendo datasource?
Below code does not work.
--MVC Controller Method returning Products results set.
public ActionResult GetProducts()
{
----------
return Json(Products, JsonRequestBehavior.AllowGet);
}
--Javascript to bind datasource
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: ('@Url.Action("GetProducts")'),
dataType: "jsonp"
}
},
pageSize: 12
});
// Model View
@model IEnumerable<Models.Product>
@{
ViewBag.Title = "Index";
}