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

Using IQueriable as ItemsSource, filtering server side

4 Answers 112 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Fabrice
Top achievements
Rank 1
Fabrice asked on 11 Nov 2015, 12:04 PM

I have a custom QueryProvider implementation, with which I'm able to intercept Linq queries on a custom collection implementation and send this query to an API, implementing server-side filtering of data; I have RadGridViews working this way.

I was trying to achieve this with the RadAutoCompleteBox, while retaining the option to keep free text input, but it seems the ToList of ItemsSource is forcefully called *before* the filtering is done (enforcing client side filtering);

I've looked at the IFilteringBehavior interface, but it seems it gets an IList (which my collection doesn't implement, will ToList be called as well?) as a parameter; is there any way to implement this? I'm going to give IFilteringBehavior a chance, just want to be sure if there's anything better or if it doesn't work.

4 Answers, 1 is accepted

Sort by
0
Sergio
Top achievements
Rank 1
answered on 11 Nov 2015, 04:48 PM
That would be an awesome feature. At least we should be able to access an external url (or something similar) to get the results to fill the autocomplete options.
0
Nasko
Telerik team
answered on 16 Nov 2015, 08:48 AM
Hello Fabrice,

In order to achieve a similar to the desired functionality what we could suggest you to use is Web Services.You could handle the TextSearchChanged event of the control, so each time the text gets changed the services will return a result (you could call your queries inside the service) and that result could be set to the ItemsSource of RadAutoCompleteBox - thus the source will be modified each time the user input changes.

We created a sample project that demonstrates that approach and you could run and evaluate we.

We hope this will help you.

Regards,
Nasko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Fabrice
Top achievements
Rank 1
answered on 16 Nov 2015, 04:02 PM
Thanks I'll take a look into it. I was trying something similar with a RadComboBox, but for some reason I'm losing the text when I free type in the Combo and then focus another cell (this Combo has no items, they are only filled with options when I request a list of suggestions by a keyboard shortcut).
0
Fabrice
Top achievements
Rank 1
answered on 17 Nov 2015, 09:21 AM

Ok, I replaced the Combo with an AutoCompleteBox, and got it to work based on your example.

This is probably meant for another forum, but to clarify the "focus another cell" part, I'm trying to implement a Column that has a free input text with possible suggestion of values, and I needed to handle the CellEditEnded event to submit the value in the AutoCompleteBox.

 You can close this thread.

Tags
AutoCompleteBox
Asked by
Fabrice
Top achievements
Rank 1
Answers by
Sergio
Top achievements
Rank 1
Nasko
Telerik team
Fabrice
Top achievements
Rank 1
Share this question
or