使用 asp.net mvc 的 Telerik Grid 的部分视图问题
我有 Telerik 网格的视图。
我有一个控制器代码,我将数据传递给视图
public ActionResult GridList(int id)
{
_genrepo.GetCategoriesForControlPlanTemplateByControlPlanID(CurrentHealthPlanId,id);
return PartialView(_viewModel);
}
Hunter:这是我的网格,
<%= Html.Telerik().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(o => o.OrderID).Width(100);
columns.Bound(o => o.ContactName).Width(200);
columns.Bound(o => o.ShipAddress);
columns.Bound(o => o.OrderDate).Format("{0:MM/dd/yyyy}").Width(120);
})
.DataBinding(dataBinding =>
{
dataBinding.Server().Select("FirstLook", "Grid", new { ajax =
ViewData["ajax"] });
dataBinding.Ajax().Select("_FirstLook",
"Grid").Enabled((bool)ViewData["ajax"]);
})
.Scrollable(scrolling => scrolling.Enabled((bool)ViewData["scrolling"]))
.Sortable(sorting => sorting.Enabled((bool)ViewData["sorting"]))
.Pageable(paging => paging.Enabled((bool)ViewData["paging"]))
.Filterable(filtering => filtering.Enabled((bool)ViewData["filtering"]))
.Groupable(grouping => grouping.Enabled((bool)ViewData["grouping"]))
.Footer((bool)ViewData["showFooter"])
%>
我能够通过分页将数据完美地显示到 grdi 中。 但问题是当我点击第二页时..整个网格在静态页面中显示我。我看不到网格。我希望它是部分视图问题。我无法在部分视图页面上实现分页排序和过滤?
任何人都可以帮助我如何避免这种情况,以处理部分视图吗?
提前致谢
I have a view with telerik grid.
Ihave a controler code which I am passing the data to the view
public ActionResult GridList(int id)
{
_genrepo.GetCategoriesForControlPlanTemplateByControlPlanID(CurrentHealthPlanId,id);
return PartialView(_viewModel);
}
Hunter: here is my grid
<%= Html.Telerik().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(o => o.OrderID).Width(100);
columns.Bound(o => o.ContactName).Width(200);
columns.Bound(o => o.ShipAddress);
columns.Bound(o => o.OrderDate).Format("{0:MM/dd/yyyy}").Width(120);
})
.DataBinding(dataBinding =>
{
dataBinding.Server().Select("FirstLook", "Grid", new { ajax =
ViewData["ajax"] });
dataBinding.Ajax().Select("_FirstLook",
"Grid").Enabled((bool)ViewData["ajax"]);
})
.Scrollable(scrolling => scrolling.Enabled((bool)ViewData["scrolling"]))
.Sortable(sorting => sorting.Enabled((bool)ViewData["sorting"]))
.Pageable(paging => paging.Enabled((bool)ViewData["paging"]))
.Filterable(filtering => filtering.Enabled((bool)ViewData["filtering"]))
.Groupable(grouping => grouping.Enabled((bool)ViewData["grouping"]))
.Footer((bool)ViewData["showFooter"])
%>
I am able to display the data perfectly in to the grdi with pagging..
but problem is when I hit the second page.. the whole grid showing me in a static page. I am not able to see the grid.. I hope its a partial view problem.. I am not able to implement pagging sorting and filtering on partial view page?
can any body help me out how to avoid this situation to work on partial views?
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一个 示例 说明了如何使用 ASP.NET 的 Telerik Grid 组件实现分页MVC。
There's an example illustrating how to implement paging with the Telerik Grid component for ASP.NET MVC.