2

我在局部视图中有 Kendo Tabstrip 控件位置,在该 tabstrip 内我有 Kendo Grid。

         @(Html.Kendo().TabStrip()
                .Name("tabstrip1")
                .Items(ts =>
                        {
                        ts.Add()
                        .Text("Tab Strip 1")
                        .Content(@<text>
                            @(Html.Kendo().Grid<testproject.Class.DiscussionBoard>()
                                .Name("kendogrid1")
                                .Columns(columns =>
                                    {
                                        columns.Bound(p => p.Name).Title("Name");
                                        columns.Bound(p => p.CreatedBy).Title("Created By");
                                        columns.Bound(p => p.Subject).Title("Subject");
                                        columns.Bound(p => p.CommentsDescription).Title("Comments/Description");
                                        columns.Bound(p => p.ModifiedOn).Title("Modified On ");
                                    })
                        .NoRecords("No Recod Exists!!")
                            )
                        </text>);
                        })
        )

当我运行这个我得到这个错误 在 kendo TabStrip 中使用 Kendo MVC Grid 时出错

我尝试在网上搜索,但没有找到太多关于这个问题的信息

ASP MVC 5 项目

总是感谢帮助

谢谢

4

1 回答 1

6

使用GridBuilder.ToHtmlString()

.Content(Html.Kendo().Grid<testproject.Class.DiscussionBoard>()
    .Name("kendogrid1")
    .Columns(columns =>
    {
        columns.Bound(p => p.Name).Title("Name");
        columns.Bound(p => p.CreatedBy).Title("Created By");
        columns.Bound(p => p.Subject).Title("Subject");
        columns.Bound(p => p.CommentsDescription).Title("Comments/Description");
        columns.Bound(p => p.ModifiedOn).Title("Modified On ");
    })
    .NoRecords("No Recod Exists!!")
    .ToHtmlString()
)
于 2015-12-04T13:10:48.873 回答