1 回答

TA貢獻(xiàn)1887條經(jīng)驗(yàn) 獲得超5個(gè)贊
這并不像你想象的那么簡(jiǎn)單,我害怕。整個(gè)實(shí)現(xiàn)可以在Telerik的文檔中找到。
簡(jiǎn)而言之,您必須:
創(chuàng)建一個(gè)對(duì)象(Text-Value 或 Id-Label)以綁定到您的列
為這個(gè)類創(chuàng)建一個(gè)編輯器模板
@(Html.Kendo().DropDownList()
.Name("Employee") // The name of the widget should be the same as the name of the property.
.DataValueField("EmployeeID") // The value of the dropdown is taken from the EmployeeID property.
.DataTextField("EmployeeName") // The text of the items is taken from the EmployeeName property.
.BindTo((System.Collections.IEnumerable)ViewData["employees"]) // A list of all employees which is populated in the controller.
)
裝飾您的財(cái)產(chǎn) [UIHint("ObjectEditor")]
- 1 回答
- 0 關(guān)注
- 139 瀏覽
添加回答
舉報(bào)