相关疑难解决方法(0)

Kendoui MVC EditorTemplateName在PopUp编辑模式下不起作用

我想在KendoUi网格中使用EditorTemplateName作为外键.

当网格编辑模式为InLine时,一切正常,我的模板已加载.但当更改模式为Popup时不加载模板.怎么解决呢?

@(Html.Kendo().Grid<Product>()
    .Name("grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.ProductId).Visible(false);
        columns.Bound(p => p.Title);

        columns.ForeignKey(p => p.CategoryId, new SelectList(ViewBag.CategoryySelectList, "Value", "Text"))
                   .EditorTemplateName("MyTemplate");

        columns.Command(cmd => cmd.Edit());
    })
    .Editable(edit => edit
        .Mode(GridEditMode.PopUp)
    )
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(15)
        .Events(events => events.Error("error_handler"))
        .Model(model =>
        {
            model.Id(p => p.ProductId);
        })
        .Read(read => read.Action("FillGrid", "Products"))
        .Update(update => update.Action("Edit", "Products"))
        .Destroy(destroy => destroy.Action("Delete", "Products"))
    )
)
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc kendo-ui kendo-grid kendo-combobox kendo-asp.net-mvc

4
推荐指数
1
解决办法
2万
查看次数