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

RadCombobox Value on Select vs Expand

2 Answers 101 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
crazy05
Top achievements
Rank 1
crazy05 asked on 31 Jul 2015, 02:08 PM

Hello,

 I have combobox with values 0, 1, 2. When user expand the combobox to select the value, I want to show Text of the value as  0 - Bad, 1 - Average, 2 - Good.

 But when user select the value, I want to display the value only.

 How can I do this ?

2 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 04 Aug 2015, 11:01 AM
Hi Ram,

In order to achieve the desired appearance of the Items first you need to bind the control's ItemSource to a collection of business objects. That object should contain information about what stands for each value - for example for 0 it stands "Bad". After that by creating an ItemTemplate you could create the desired appearance for the Items placed inside the DropDown portion of the control. On the other hand using the SelectionBoxTemplate you could achieve the desired appearance of the item into the selection box part of the control. For a more detailed information please, check the following articles from our help documentation:
http://docs.telerik.com/devtools/wpf/controls/radcombobox/features/populating-with-data-selectionbox

and about the ItemTemplate:
http://docs.telerik.com/devtools/wpf/controls/radcombobox/populating-with-data/binding-to-object#using-custom-itemtemplate

We have created a sample project that demonstrates the described above approach and you you could run and evaluate it.

Hopes this helps.  

Regards,
Nasko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
crazy05
Top achievements
Rank 1
answered on 04 Aug 2015, 02:41 PM
Nice! It worked. Thanks!
Tags
ComboBox
Asked by
crazy05
Top achievements
Rank 1
Answers by
Nasko
Telerik team
crazy05
Top achievements
Rank 1
Share this question
or