Manually fire text search

2 posts, 0 answers
  1. Adam
    Adam avatar
    70 posts
    Member since:
    Jun 2008

    Posted 29 May 2013 Link to this post

    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.

  2. Ventzi
    Ventzi avatar
    114 posts

    Posted 30 May 2013 Link to this post

    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.


    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top