Using IQueriable as ItemsSource, filtering server side

5 posts, 0 answers
  1. Fabrice
    Fabrice avatar
    22 posts
    Member since:
    Jan 2015

    Posted 11 Nov 2015 Link to this post

    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.

  2. Sergio
    Sergio avatar
    1 posts
    Member since:
    Sep 2014

    Posted 11 Nov 2015 Link to this post

    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.
  3. DevCraft R3 2016 release webinar banner
  4. Nasko
    Nasko avatar
    555 posts

    Posted 16 Nov 2015 Link to this post

    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.

    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
  5. Fabrice
    Fabrice avatar
    22 posts
    Member since:
    Jan 2015

    Posted 16 Nov 2015 in reply to Nasko Link to this post

    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).
  6. Fabrice
    Fabrice avatar
    22 posts
    Member since:
    Jan 2015

    Posted 17 Nov 2015 in reply to Fabrice Link to this post

    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.

Back to Top
DevCraft R3 2016 release webinar banner