AutoComplete and database query

4 posts, 0 answers
  1. JMazeran
    JMazeran avatar
    12 posts
    Member since:
    May 2012

    Posted 25 Sep 2013 Link to this post

    Hello,

    We want to create an AutoComplete (or RadComboBox IsEditable=true) binded to a collection of 60.000 items so we would like that the control create the query in database (with like % for exemple) as to the user type the keyword and view the result in the choice popup of the combo

    How to do this ?
    Thx
  2. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 30 Sep 2013 Link to this post

    Hello,

    I'm sending you a sample project demonstrating how you can use data from DB and Entity model in order to populate RadAutoCompleteBox with items. You can take a look at it and modify it based on your needs (I've used EntityFramework but if your needs require another approach, you can use it in the same manner in order to get the items and set them as ItemsSource of RadAutoCompleteBox).

    Hopefully this helps.

    Regards,
    Rosen Vladimirov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Anthony
    Anthony avatar
    13 posts
    Member since:
    Aug 2014

    Posted 23 Aug 2014 in reply to Rosen Vladimirov Link to this post

    How do you use the database in this example project? I tried to run it after installing EntityFramework, but it doesn't see the database. What do I have to do with it for the database to work? Do I need to install it in a SQL server instance?
  5. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 26 Aug 2014 Link to this post

    Hello Anthony,

    There's no need to put the database on SQL Server, it can be used as a LocalDB in Visual Studio. I'm sending my project again - I've made some small changes when getting items from DB (now items, that are already selected will not be included in the filtered result shown in the drop down) and I've added required EntityFramework dll to the project. You can try the new attachment and see if it works on your side (you'll have to add references to Telerik dlls).

    Hope this helps.

    Regards,
    Rosen Vladimirov
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top