开发者

HOw to use SelectedValuePath to get the ID

开发者 https://www.devze.com 2023-03-28 10:18 出处:网络
I want to Get the Database ID of the item selectd in the Combo box in silverlight either by using SelectedValuePath or by any other wa开发者_StackOverflowy.

I want to Get the Database ID of the item selectd in the Combo box in silverlight either by using SelectedValuePath or by any other wa开发者_StackOverflowy. Please suggest.


In XAML you must to write de name your Id in the combobox:

SelectedValuePath="ID"

where "ID" is the name of your field.

To get the selected value in c#:

int id=(int)myComboBox.SelectedValue;
0

精彩评论

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