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

Associating string values to Items

2 Answers 49 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Iron
Stephen asked on 20 Sep 2013, 11:11 PM
I have several ComboBox's that display items in a meaningful was to my users, but actually reflect something else. For example, the ComboBox might display car part descriptions, but for processing I need to know the actual part number that the part description was derived from. Is there anyway to associate the part number with the items being displayed in the ComboBox?

2 Answers, 1 is accepted

Sort by
0
Rosen Vladimirov
Telerik team
answered on 25 Sep 2013, 08:54 AM
Hello Stephen,

The best way to achieve this is to use collection of objects for ItemsSource of your RadComboBox. After that you can use DisplayMemberPath property to select which of the property of the object to be shown to the user. In this scenario the SelectedItem will be your object. You can also use SelectedValuePath property to indicate which of object's properties will be used as SelectedValue of the combo.

I'm sending you a sample project demonstrating this approach. Please check it and inform us in case you have any problems or concerns.

Regards,
Rosen Vladimirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Stephen
Top achievements
Rank 1
Iron
answered on 04 Oct 2013, 11:24 PM
Thanks, all. We got it shortly after our original posting.
Tags
ComboBox
Asked by
Stephen
Top achievements
Rank 1
Iron
Answers by
Rosen Vladimirov
Telerik team
Stephen
Top achievements
Rank 1
Iron
Share this question
or