RadComboBox does not display correctly selected item if DisplayMemberPath uses indexer

3 posts, 1 answers
  1. Roman
    Roman avatar
    12 posts
    Member since:
    Oct 2011

    Posted 21 Oct 2011 Link to this post

    Hi,

     

    I have problem related with RadComboBox. It does not display correctly selected item if DisplayMemberPath uses indexer.

     Xaml:
    <controls:RadComboBox
        ItemsSource="{Binding PersonCollection}"
        SelectedItem="{Binding SelectedPerson, Mode=TwoWay}"
            DisplayMemberPath="[Name]" />

    I debugged this situation using .Net Reflector and find out that when SelectedItem is changed the RadComboBox tries to change the Text.

    To get value from indexer it is used “BindingExpressionHelper.CreateGetValueFunc” function.

    Inside this function there is an attempt to create a method to get the value. During the process of creation of the method the argument exception is thrown and as result swallows exception and uses another one method to get the value.

    So the method returns empty string (because it has wrong method to get value) and it is displayed in ComboBox TextBox (instead of proper value).

     

    How can i resolve this behavior?



    P.S. System.Windows.Controls.ComboBox works fine with the same conditions.


    Thanks to all,

    Roman Denysenko

  2. Answer
    Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 26 Oct 2011 Link to this post

    Hi Roman,

    This is a bug in RadComboBox that will be fixed in the upcoming internal build.

    Your points have been updated.

    All the best,
    Valeri Hristov
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft banner
  4. Roman
    Roman avatar
    12 posts
    Member since:
    Oct 2011

    Posted 27 Oct 2011 Link to this post

    Thank You, Valeri!
    New build solves the problem.
Back to Top