This is a migrated thread and some comments may be shown as answers.

ValuePath property?

2 Answers 92 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Morgan
Top achievements
Rank 1
Morgan asked on 18 Mar 2011, 01:02 AM
In other products, I had a ValuePath property and Value property, which allowed me to specify
1. The property of the lookup collection to use for the identifier of the value on the data context (ValuePath)
2. The value of the item in the data context, uh, (Value)

I assume SelectedValue is the property for Value?

Is there a ValuePath property? How do I specify that StateId from a State collection bound to the radcombo is the property to use for StateId on a Address object?

Thanks,

Morgan

2 Answers, 1 is accepted

Sort by
0
Accepted
Valeri Hristov
Telerik team
answered on 18 Mar 2011, 02:50 PM
Hi Morgan,

The property you need is SelectedValuePath. So for example if the DataContext is an object Order with property ClientID of type int. RadComboBox is bound to a collection of Client objects, the combo declaration should be something like this:

<telerik:RadComboBox ItemsSource="{Binding AllClients}" SelectedValuePath="ClientID" DisplayMemberPath="FullName" SelectedValue="{Binding ClientID, Mode=TwoWay}" />

Best wishes,
Valeri Hristov
the Telerik team
0
Morgan
Top achievements
Rank 1
answered on 22 Mar 2011, 12:41 AM
Wonderful. Thanks for the clarification.
Tags
ComboBox
Asked by
Morgan
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Morgan
Top achievements
Rank 1
Share this question
or