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

RadComboBox does not display correctly selected item if DisplayMemberPath uses indexer

2 Answers 109 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Roman
Top achievements
Rank 1
Roman asked on 21 Oct 2011, 12:15 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Valeri Hristov
Telerik team
answered on 26 Oct 2011, 09:05 AM
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 >>
0
Roman
Top achievements
Rank 1
answered on 27 Oct 2011, 08:32 AM
Thank You, Valeri!
New build solves the problem.
Tags
ComboBox
Asked by
Roman
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Roman
Top achievements
Rank 1
Share this question
or