In MVC 5 Kendo paging, sorting is not working
Hi,
I am developing a project in MVC 5 using KENDO Telerik. In that I am using Kendo gridview.
this is my code
View Code:
@(Html.Kendo().Grid(Model)
.Name("grid")
.Columns(columns =>
{
columns.Bound(c => c.ad_user_id).Title("User");
columns.Bound(c => c.title).Title("Title Description");
columns.Bound(c => c.date_created).Title("Created Date");
//columns.Bound(Html.);
})
//.HtmlAttributes(new { style = "height: 380px;" })
.Scrollable()
.Groupable()
.Sortable()
.Pageable()
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("ViewChangeLogs", "ExternalApplicationa"))
)
)
Controller code
public ActionResult ManageUsers(string name, [DataSourceRequest]DataSourceRequest request)
{
IQueryable<SP_ManageUsers_Result> users = db.SP_ManageUsers().AsQueryable();
DataSourceResult result = users.ToDataSourceResult(request);
return Json(result);
}
error:
The result of a query cannot be enumerated more than once.
How to use kendo gridview in mvc 5. Is anything wrong in my code.
I need to implement paging, sorting and all those things,