【发布时间】:2014-03-28 04:40:06
【问题描述】:
这是我的实体编辑页面代码,
@(Html.Kendo().DropDownListFor(x => x.ParentCategoryId).Name("ParentCategoryId").HtmlAttributes(new { style = "width:300px;" }).DataTextField("Name").Value("ID").DataValueField("ID")
.DataSource(source => { source.Read(read => { read.Action("GetCategory", "Category"); }); }))
我想通过 Model.ParentCategoryId 设置下拉列表选择项
是否有可能 dropdownlist.selectedvalue = Model.ParentCategoryId ?
【问题讨论】:
-
是的,你是对的,绑定很好。但是,在我的 editpview 中,我想通过 model.ParentCategoryId 在 kendo 下拉列表中选择项目?
标签: c# javascript asp.net-mvc model-view-controller kendo-ui