3

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 ? Here is my Code

 <telerik:RadComboBox ItemsSource="{Binding Flags}"
                            SelectedValue="{Binding FlagId,Mode=TwoWay}"
                            SelectedValuePath="Id"
                            DisplayMemberPath="Id">               
 </telerik:RadComboBox>
Chatra
  • 2,989
  • 7
  • 40
  • 73

1 Answers1

0

You'll need to switch DisplayMemberPath="Id" to some property of the type Flags is, that displays the ID and description in the format you want.

matt
  • 333
  • 2
  • 10
  • 23
  • 1
    Yes I gave the DisplayMemberPath as Name which contains "0 - Bad" as string. But my scenario is different. I don't want that string to display when they select. Users want to see 0 only – Chatra Jul 31 '15 at 19:38
  • looks like a solution. Will look into it. Thanks! – Chatra Jul 31 '15 at 20:04