【问题标题】:Kendo MVC Grid inside Kendo TabStripKendo TabStrip内的Kendo MVC Grid
【发布时间】:2015-12-04 09:59:37
【问题描述】:

我在局部视图中有 Kendo 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>);
                        })
        )

当我运行它时,我得到了这个错误

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

ASP MVC 5 项目

我们永远感谢您的帮助

谢谢

【问题讨论】:

    标签: asp.net-mvc kendo-grid kendo-asp.net-mvc kendo-tabstrip


    【解决方案1】:

    使用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()
    )
    

    【讨论】:

    • 谢谢大佬 :) 终于可以继续做其他工作了
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多