目前,如果您选择选择值选项,它不会选择一个值。无论如何我可以在内联网格下拉列表中添加选择值吗?添加和编辑记录时
GridForeignKey.cshtml
@(
Html.Kendo().DropDownList()
.Name(ViewData.TemplateInfo.GetFullHtmlFieldName(""))
.BindTo((SelectList)ViewData[ViewData.TemplateInfo.GetFullHtmlFieldName("") + "_Data"])
.OptionLabel("Select value")
)
看法:
columns.ForeignKey(p => p.SSID, (System.Collections.IEnumerable)ViewData["dataStatus"], "OptID", "OptName");
控制器:
private void PopulateDataStatus()
{
ViewData["dataStatus"] = new HEntities().COpts
.Select(e => new COptModel
{
OptID = e.OptID,
OptName = e.OptName,
CTypeID = e.CTypeID
})
.Where(e => e.CTypeID == 99)
.OrderBy(e => e.OptName);
}
那么我如何添加选择值文本,请指教?