This question is locked. New answers and comments are not allowed.
Dear All,
Im want to use nhibernate to bind telerik mvc grid.
im returning a iqueryable object to the grid, but it seems that by each request all records will be returned to the grid.
this is the view:
<%= Html.Telerik().Grid<UserViewModel>()
.Name("Grid")
.Columns(columns =>
{
columns.Bound(o => o.Id).Width(200);
columns.Bound(o => o.FirstName);
columns.Bound(o => o.LastName);
})
.Sortable()
.Filterable()
.Scrollable()
.Pageable(p => p.PageSize(20).Total((int)ViewData["total"]))
.DataBinding(dataBinding => dataBinding.Ajax().Select("_Select", "Users"))
%>
and the controller:
[GridAction]
public ActionResult _Select(GridCommand command)
{
IQueryable<UserViewModel> users = _userService.getallusers();
ViewData["total"] = users.Count();
return View(new GridModel(users));
}
how can i fix this issue?
thanks in advance.
Im want to use nhibernate to bind telerik mvc grid.
im returning a iqueryable object to the grid, but it seems that by each request all records will be returned to the grid.
this is the view:
<%= Html.Telerik().Grid<UserViewModel>()
.Name("Grid")
.Columns(columns =>
{
columns.Bound(o => o.Id).Width(200);
columns.Bound(o => o.FirstName);
columns.Bound(o => o.LastName);
})
.Sortable()
.Filterable()
.Scrollable()
.Pageable(p => p.PageSize(20).Total((int)ViewData["total"]))
.DataBinding(dataBinding => dataBinding.Ajax().Select("_Select", "Users"))
%>
and the controller:
[GridAction]
public ActionResult _Select(GridCommand command)
{
IQueryable<UserViewModel> users = _userService.getallusers();
ViewData["total"] = users.Count();
return View(new GridModel(users));
}
how can i fix this issue?
thanks in advance.