0
想象一下我對文件中的網格/Views/Home/Index.cshtml:綁定EditorTemplate文件,以網格組合框在劍道UI MVC
@model IEnumerable<KendoMVCWrappers.Models.StockWebAndDetailsView>
@(Html.Kendo().Grid(Model)
.Name("Grid")
@* Other columns and dataSource in here *@
columns.Bound("QuantityToEnquiry").Filterable(false).Sortable(false)
.EditorTemplateName("QuantityToEnquiry");
})
而且我對文件/瀏覽/ EditorTemplateName/QuantityToEnquiry.cshtml(我也試過在〜/查看/共享/ EditorTemplates/):
@(Html.Kendo().ComboBox()
.Name("QuantityToEnquiry")
.Value("1")
.BindTo(Enumerable.Range(1, 100).ToList())
在模型中我有:
public class StockWebAndDetailsView
{
[UIHint("QuantityToEnquiry")]
public int QuantityToEnquiry { get; set; }
}
所顯示的數據是空,值爲「空」的字符串,我不知道爲什麼。
你的意思是「顯示的數據爲空」?它是否在下拉列表中?當你使用Html.DropDownList時會發生什麼? –
嗨@AtanasKorchev它輸出一個空字符串,而不是一個組合框。 – Tito
在這種情況下Html.DropDownList輸出是什麼? –