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

Manually fire text search

1 Answer 48 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 29 May 2013, 12:03 PM
Hey there,

We have a ComboBox control set up that does a search/query on demand as a user types into the control.  This inevitably refreshes and filters the itemssource underneath the combobox as we go.  It appears that, when the ItemsSource is updated, any selected value that was selected by way of the text search filtering is lost.  Is there any mechanism to signal to the ComboBox to update its selected value based on the current text entered?  I suppose, if the filtering is done correctly, that the first visible item in the list may very well always be the item needing selected, but I was just curious if there was the native ability to let the ComboBox handle this on its own.

Thanks!
Adam.g

1 Answer, 1 is accepted

Sort by
0
Ventzi
Telerik team
answered on 30 May 2013, 08:29 AM
Hi Adam,

 RadComboBox is designed to recognize and select the items which are equal in the new ItemsSource collection. This means that if you select an item from collection1 and then you change the ItemsSource to collection2 which contains the "same" item as the selected one, the RadComboBox should automatically select this item in the collection2. 

In order to tell RadComboBox which items are equal you need to override the Equals method of the data item on which the RadComboBoxItem is bound. Doing this the RadComboBox control should recognize and select the item.

If you are still experiencing this issue after overriding the Equals method, please open a support ticket and send us a sample project where we could closely investigate this behavior.

Regards,
Ventzi
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ComboBox
Asked by
Adam
Top achievements
Rank 1
Answers by
Ventzi
Telerik team
Share this question
or