开发者

Can ComboBoxItem holds object value?

开发者 https://www.devze.com 2023-02-10 23:40 出处:网络
From my experience in silverlight, their comboBoxItem can holds object data, so I can do like ComboBox.selectedItem and cast to the data object type and get the databinding object out.

From my experience in silverlight, their comboBoxItem can holds object data, so I can do like ComboBox.selectedItem and cast to the data object type and get the databinding object out.

But in Asp.Net, the ComboBoxItem seems like only have Text and Valu开发者_Go百科e property for databinding. I wonder if there is a way that I can get the databinding object out? Not with searching the datasource and find the object by Text and Value...

Thanks in advance.


You can try this in the code behind with VB...

CType(ddlDropDownList.Items(ddlDropDownList.SelectedIndex), ObjectType)
0

精彩评论

暂无评论...
验证码 换一张
取 消