解答如何在Kendo ListView中呈现编辑模板

时间:2014-04-03 21:43:59

标签: kendo-asp.net-mvc kendo-template kendo-listview

回答以下问题Kendo MVC ListView Editing

1 个答案:

答案 0 :(得分:0)

MVC中的Kendo使用具有以下路径View / Shared / EditorTemplates的文件夹 在此文件夹中,您必须插入您按名称调用的所有模板,例如:

@(Html.Kendo().ListView<temp.Models.YourTable>(Model)
    .Name("LisView")
    .TagName("div")
    .ClientTemplateId("templateView") => here goes the template for data
    .DataSource(dataSource => dataSource
        .Model(m => m.Id("ID"))
        .ServerOperation(false)
        .Read(read => read.Action("ActionRead", "Controller"))
    )
    .Editable(edit => edit.TemplateName("EditTmpl")) 
)

EditTmpl =&gt; //此模板是您必须存储在我上面提到的文件夹中的模板。

希望这会有所帮助。