Introduction In this article we will see about SelectedValue and SelectedValuePath while Binding. This feature is added in Silverlight 4. SelectedValue and SelectedValuePath These properties enable a ComboBox to behave as a look up table, that means a value can be displayed in ComboBox but when selected another property would be selected. Let's do a sample where we can see it. Let's have a ComboBox to display the data and a TextBlock which will display another property of the bound data of ComboBox. Let's have sample data which can be bound to ComboBox. The above class represents a sample Employee Entity structure. Now in xaml we need to do proper binding as follows: As you see in above xaml display, we have set the SelectedValuePath which is different from the displaying Path. In our case SelectedValuePath is "EmailID" and for display it is "EmployeeName". In the TextBlock, the Text property is bound to the SelectedValue of the Element ComboBox. Now let's run the application and see the Properties in action. That's it. It's easy in Silverlight 4 to use SelectedValue and SelectedValuePath for displaying one property and displaying another property on selection. Hope this article helps.
SelectedValue and SelectedValuePath in Silverlight 4
Notification Window in Silverlight 4
Hi, In your code iam getting this error for silverlight Combobox SelectedValuePath was not found in type combobox. Regards Ram
Thanks for the useful post, but what about Contact? can we display it in another text block besides the Email textblock? i means..1 combo box and more text blocks...
Hi,thanks for wonderful article.can u please suggest how to pass those two values to another page.I m unable to retrieve value selected in combobx as slectedvalue is bound to value in textbox.Is ther any way to get the value in combobox.Please suggest me.I m in great need of this.If i m using combox.selectedvalue i m getting value in textbox.but i need selected value in combobx.Thanks.Smitha.