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

RadComboBox, Enum and item value

2 Answers 148 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Gabriel
Top achievements
Rank 1
Gabriel asked on 23 Jan 2012, 11:08 PM
I've used this link to bind my Enum to my RadComboBox but when I browse thru the items, the combobox does not select anything, its always empty. I've check my ViewModel and it does make a Get to grab the value and send it to the converter. And if I change the selected item, it will update the ViewModel with the new selection and the ComboBox will also display the correct value. Again, if I navigate away and back to this item, the RadComboBox will be empty. Here's my RadCombobox XAML:

<telerik:RadComboBox
    HorizontalAlignment="Left"  Height="25" MinWidth="75"
    VerticalAlignment="Top"               
    ItemsSource="{Binding Source={StaticResource QueryDocumentsEnumerationDS}, Path=Values, Mode=OneWay}"
    DisplayMemberPath=""
    SelectedValue="{Binding DocumentOnly, Mode=TwoWay, Converter={StaticResource EnumConverter}}"                                 
    Margin="0,0,8,0" />

Any clues?

thanks

2 Answers, 1 is accepted

Sort by
0
Gabriel
Top achievements
Rank 1
answered on 24 Jan 2012, 03:42 PM
Solved, and I insist it was not my fault...

In a previous attempt to bind to enum, I used a converter which have persisted in the previous code. Here the code that work:

<telerik:RadComboBox
    HorizontalAlignment="Left"  Height="25" MinWidth="75"
    VerticalAlignment="Top"              
    ItemsSource="{Binding Source={StaticResource QueryDocumentsEnumerationDS}, Path=Values, Mode=OneWay}"
    DisplayMemberPath=""
    SelectedValue="{Binding DocumentOnly, Mode=TwoWay}"                                
    Margin="0,0,8,0" />

0
Yana
Telerik team
answered on 26 Jan 2012, 02:24 PM
Hello Gabriel,

I'm glad the you've managed to fix the issue by yourself. We will review the article.

Kind regards,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
ComboBox
Asked by
Gabriel
Top achievements
Rank 1
Answers by
Gabriel
Top achievements
Rank 1
Yana
Telerik team
Share this question
or