我有一个主网格,但有两个细节网格(同一级别的细节网格)。但是 Telerik mvc 网格无法呈现相同的内容。
所以我只是尝试了详细的主网格作为简单的模板,如下所示。
@(Html.Telerik().Grid<VIDEO_MASTER>()
.Name("Videos")
.Columns(col =>
{
col.Bound(t => t.VIDEO_ID).Hidden(true);
col.Bound(t => t.VIDEO_NAME).Width(200).Title("Video Name");
col.Bound(t => t.VIDEO_SHORT_NAME).Width(150).Title("Video Short Name");
col.Bound(t => t.VIDEO_ALTERNATE_NAME).Width(200).Title("Video Alternate Name");
col.Bound(t => t.PART_NUMBER).Width(60).Title("Part No");
col.Bound(t => t.DURATION).Width(80).Title("Duration");
col.Command(cmd =>
{
cmd.Edit().ButtonType(GridButtonType.Image);
cmd.Delete().ButtonType(GridButtonType.Image);
}).Width(100).Title("Cmd");
})
.ToolBar(commands =>
{
commands.Insert().ButtonType(GridButtonType.ImageAndText).HtmlAttributes(new { id = "masterAddBtn" });
commands.Custom().HtmlAttributes(new { id = "export" }).Text("Export").Action("Video_Export", "Video");
commands.Custom().HtmlAttributes(new { id = "exportdet" }).Text("Export Detail").Action("Video_ExportDet", "Video");
})
.DataKeys(keys => keys.Add(tkey => tkey.VIDEO_ID).RouteKey("id"))
.DataBinding(dataBinding => dataBinding.Ajax()
.Select("Select_Videos", "Video")
.Insert("Insert_Videos", "Video")
.Update("Update_Videos", "Video")
.Delete("Delete_Videos", "Video")
)
.ClientEvents(events => events.OnDataBound("onDataBound").OnEdit("onEdit"))
.Pageable(pagezie => pagezie.PageSize(5))
.Filterable()
.Scrollable(s => s.Height(440))
.DetailView(details => { details.ClientTemplate("<p>Hello</p>");
details.ClientTemplate("<p>Hi</p>");
})
)
出了什么问题?MVC telrik 网格不支持两个详细信息行?