Refresh ItemsSource based on user Input

5 posts, 1 answers
  1. Jan
    Jan avatar
    8 posts
    Member since:
    Jul 2012

    Posted 04 Nov 2012 Link to this post


    The scenario that I'm trying to implement is to use a RadAutoCompleteBox that takes user input and after a few milliseconds that they stop typing updates the ItemsSource with a filtered list from a domain service using the entered value. I dont want to retrieve all possible entries from the start as there are way too many to return, hence the filter on the server.

    I dont know what the correct method would be to do so, but I've manage to use the SearchTextChanged event along with timers to fire a query to the server to update the List that is bound to the ItemsSource. It works well but the results is not visible until i re-focus the Autocomplete control.

    I'm sure there is most likely a better way of doing this and any suggestions would be appreciated.


    PS. I'm using a MVVM approach.
  2. Answer
    Ivo avatar
    390 posts

    Posted 08 Nov 2012 Link to this post

    Hello Jan,

    This scenario can be achieved easily in MVVM manner. Binding the RadAutoCompleteBox' SearchText TwoWay and updating the ItemsSource when the SearchText changes will do the trick. I prepared a sample project demonstrating this. The project also includes the timer logic you mentioned.

    All the best,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Jan
    Jan avatar
    8 posts
    Member since:
    Jul 2012

    Posted 10 Nov 2012 Link to this post

    Thank you. Its appreciated :)
  5. Jango
    Jango avatar
    4 posts
    Member since:
    May 2013

    Posted 19 Sep 2013 Link to this post


    I Tried your suggestion, and found it not perfect.

    After populating the ObservableCollection, the RadAutoCompleteBox doesn't select the first Item in the list, with the standard and the user must use down arrow key in order to select the first Item...

    Is there any way to perform that in MVVM ?

  6. Vladi
    Vladi avatar
    743 posts

    Posted 24 Sep 2013 Link to this post


    We managed to observe the issue and it seems there is a bug in the current version of the RadAutoCompleteBox control when implementing custom populating mechanism in order to add a delay. We logged the issue in our Public Issue Tracker System where you can track its status.

    I updated your Telerik points for bringing this to our attention. We apologize for any inconvenience that this may be causing.

    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
DevCraft banner