How to view the SQL query generated by RadAutoCompleteBox

4 posts, 0 answers
  1. Adam
    Adam avatar
    3 posts
    Member since:
    Feb 2015

    Posted 24 Apr 2015 Link to this post

    How can I inspect the SQL query that is generated by a Telerik RadAutoCompleteBox using the visual studio debugger?
  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 27 Apr 2015 Link to this post

    Hi Adam,

    Thank you for contacting us.

    In the most basic scenario where the RadAutoCompleteBox control's ItemsSource is simply bound to a collection in your ViewModel the user entered input could be taken from the SearchText property of the control. This property represents the currently visible text in the control. Have in mind that when the control is used in its default "Multiple" SelectionMode, if an filtered item is selected from its drop down the SearchText will be reset to a string.Empty value. And when the control is in its "Single" SelectionMode the SearchText is updated to the full text of the selected item.

    Hope this information is helpful. If we have missed something please let us know.

    Regards,
    Vladi
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Adam
    Adam avatar
    3 posts
    Member since:
    Feb 2015

    Posted 27 Apr 2015 in reply to Vladi Link to this post

    Hi Vladi,

    Thanks for the info. I'm not looking for the text the user entered into input. I am trying to view the SQL query that is generated by the control by combining the SqlDataSource SelectCommand with the SearchText and with the other options such as MaxResultCount and Filter.

     I tried to view this by trapping the control state using OnDataSourceSelect event, however, it appears that if this event is used, it assumes that the developer wants to implement custom server-side filtering of the data. I want instead to view the queries that are generated with the out-of-the-box configuration.

     Thanks,

    Adam.

  5. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 28 Apr 2015 Link to this post

    Hi Adam,

    We are not sure we understand the whole scenario from your project and the related questions. By design the RadAutoCompleteBox control requires its ItemsSource to be populated before is filtering mechanism is triggered. The filtering of the control is handled by its FilteringBehavior. Could you describe to us the setup in your project:
    • How is the control's ItemsSource populated
    • Where and how are you making connection from your DB to the RadAutoCompleteBox control
    • In which SelectionMode is the control used
    • Are there any specific bindings to the properties of the control etc.

    If you could try to isolate the issue in a sample project and send it to us in a new support thread it would be very helpful in fully understanding the scenario in order to further investigate it.

    Regards,
    Vladi
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top