我正在使用编辑器模板为我的网格中的一列显示一个组合框。我想从 value 属性以外的模型属性设置组合框的初始文本。我通常可以使用 Text 运算符来执行此操作,但因为这是在网格内,所以我需要从该特定行的数据中加载。这是我的编辑器模板代码:
@(Html.Kendo().ComboBoxFor(Function(x) x) _
.DataTextField("PartNumber") _
.DataValueField("PartID") _
.MinLength(2) _
.AutoBind(False) _
.Text( "what do I put here" ) _
.Filter(FilterType.StartsWith) _
.DataSource(Sub(dataSource)
dataSource _
.Read(Sub(reader)
reader.Action("StartsWith", "Part")
reader.Type(HttpVerbs.Post)
End Sub) _
.ServerFiltering(True)
End Sub)
)