有一个像这样定义的下拉列表
@(Html.Telerik().DropDownList()
.Name("Partners")
.BindTo(@Model.AccountsList)
.HtmlAttributes(attributes: new { @id = "partnerDropDown", @class = "stdDroplist" })
.Placeholder(“Select”)
.ClientEvents(events => events.OnClose("PartnerSelected")
)
//代码隐藏
myList = (from account in myAccounts
select new displayUX
{
Name = account.Name,
Number = account.AccountNumber,
CARCode = account.BTypeCode
}).Distinct().ToList();
this.AccountsList = new SelectList(myList, "Name", "Number", selectedId);
//您的信息,System.Web.Mvc
public SelectList(IEnumerable items, string dataValueField, string dataTextField, object selectedValue);
我想为下拉列表中的每个项目传递其他数据“CARCode”。因此,当选择项目时,除了知道数字和名称之外,我还需要知道'CARCode'。 如何传递值以及如何检索它。