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

Refresh ItemsSource based on user Input

4 Answers 206 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Jan
Top achievements
Rank 1
Jan asked on 05 Nov 2012, 01:37 AM
Hi,

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.

JJ

PS. I'm using a MVVM approach.

4 Answers, 1 is accepted

Sort by
0
Accepted
Ivo
Telerik team
answered on 08 Nov 2012, 09:05 AM
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,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Jan
Top achievements
Rank 1
answered on 10 Nov 2012, 08:15 AM
Thank you. Its appreciated :)
0
Jango
Top achievements
Rank 1
answered on 19 Sep 2013, 05:22 PM
Hi,

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 ?

Thx
0
Vladi
Telerik team
answered on 24 Sep 2013, 10:24 AM
Hi,

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.

Regards,
Vladi
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
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 >>
Tags
AutoCompleteBox
Asked by
Jan
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Jan
Top achievements
Rank 1
Jango
Top achievements
Rank 1
Vladi
Telerik team
Share this question
or