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

ComboBox selecteditem text changes to a namespace

1 Answer 82 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Colin
Top achievements
Rank 1
Colin asked on 04 Oct 2011, 06:25 PM
Hi guys,

This issue has probably been seen before, but I was unsuccessful at searching for a solution.

I am working with a ComboBox bound to an ObservableCollection.  I am not having issues when the ComboBox is set to IsEditable=false.  When false, all members are displayed properly, including the selecteditem.

When IsEditable=true, upon selection of the combobox, the text (for the editing text) changes to the namespace of the initial selectedvalue's object rather than the string value of the object's name property.  The object's name property is still properly displayed on the other items in the combobox.  If I replace the text, it searches through the other items just fine. When an item in the combobox is selected, it binds back to the selectedvalue just fine.  Upon reselecting the combobox, the same thing happens again.

<telerik:RadComboBox x:Name="RadComboBox4"
IsTextSearchEnabled="True" IsEditable="True" VerticalAlignment="Center"
DataContext="{StaticResource DataContextProxy}" ItemsSource="{Binding DataSource.MyObjects}"
SelectedValue="{Binding DataSource.CurrentCachedObject.MyObjectsSubObject, Mode=TwoWay}"
DisplayMemberPath="Name" StaysOpenOnEdit="True" IsFilteringEnabled="True" TextSearchMode="Contains" OpenDropDownOnFocus="True" CanAutocompleteSelectItems="True" CanKeyboardNavigationSelectItems="True"
telerik:TextSearch.TextPath="Name" />

I might add that this is being used in a CellEditTemplate inside of a RadGridView.

Please help!

Thanks,
Colin

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 07 Oct 2011, 11:08 AM
Hello Colin,

I guess that you need to set SelectedValuePath property of the ComboBox.

Please try it and if it doesn't help, send us additional details about your scenario which will help us reproduce the problem. Thanks

Regards,
Yana
the Telerik team

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

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