RadComboBox, Enum and item value

3 posts, 0 answers
  1. Gabriel
    Gabriel avatar
    18 posts
    Member since:
    Jun 2011

    Posted 23 Jan 2012 Link to this post

    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. Gabriel
    Gabriel avatar
    18 posts
    Member since:
    Jun 2011

    Posted 24 Jan 2012 Link to this post

    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" />

  3. DevCraft banner
  4. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 26 Jan 2012 Link to this post

    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 >>

Back to Top