Kendoui MVC EditorTemplateName not working in PopUp edit mode

I want to use EditorTemplateName for a foreign key column in a KendoUi grid.

when the mesh editing mode is InLine, everything is fine and my template is loaded. but when the change mode in Popup does not load the template. How to fix it?

@(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")) ) ) 
+4
source share
1 answer

When using InLine / InCell vs. Popup rendering really isn't handled the same way. For the latter, the editor template that will actually be used is inferred from the name, so you put the Product.cshtml template in ~Views/Shared/EditorTemplates .

This article details this: http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/editor-templates .

+8
source

Source: https://habr.com/ru/post/1491659/


All Articles