kendo mvc 中的可编辑列

editable column in kendo mvc

我想在 kendo mvc 网格中创建可编辑的列

在kendo

columns.Bound(c => c.g).EditorTemplateName("MyTemplate");

在文件夹 Shared/EditorTemplates 中在文件 MyTemplate.cshtml

@model MyModel
@(Html.Kendo().EditorFor(c=>c.g)
)

但我的解决方案不正确。为什么?

您是否尝试将 "Editable" option of the Grid? Basically you should enable this option and than disable the editing for the desired columns from the DataSource or using "ScaffoldColumn" 属性设置为 false:

.Model(model=> {
  model.Field(m => m.ProductName).Editable(false);
})