第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

劍道網(wǎng)格 DropDownList 不起作用

劍道網(wǎng)格 DropDownList 不起作用

C#
HUX布斯 2021-10-23 16:40:46
無(wú)法在劍道網(wǎng)格中綁定 DropDownList。如果它不在網(wǎng)格內(nèi),它工作正常。我嘗試使用@(Html.Kendo().DropDownList()                                      .Name("RegionId")                                      .OptionLabel("[|[Select...]|]")                                      .DataTextField("Name")                                      .DataValueField("Id")                                      .DataSource(source =>                                      {                                          source.Read(read =>                                          {                                              read.Action("FindAll", "region")                                                  .Data("filterRegion");                                          })                                           .ServerFiltering(true);                                      })                                      .HtmlAttributes(new { @required = "" })                                      .Enable(false)                                      .AutoBind(false)                                      .CascadeFrom("CountryId")                                       .ValuePrimitive(true).HtmlAttributes(new { @required = "" })    )并將其綁定為文本框,而不是下拉列表。如何讓它綁定下拉列表?注意:值在數(shù)據(jù)庫(kù)中沒(méi)有關(guān)系我只需要列并通過(guò)代碼制作。
查看完整描述

1 回答

?
慕工程0101907

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")]


查看完整回答
反對(duì) 回復(fù) 2021-10-23
  • 1 回答
  • 0 關(guān)注
  • 139 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)