LoadOnDemand triggered by enter key

5 posts, 0 answers
  1. Aaron Gibbs
    Aaron Gibbs avatar
    23 posts
    Member since:
    Dec 2007

    Posted 25 Jan 2012 Link to this post

    Good morning,

    We are using a RadCombobox within a user control as an employee selector tool.  User types in a few characters of an employee name or number and it auto-populates with matches from our database.

    The problem is our database is rather large and depending on the speed of the person typing it is sometimes performing a callback and executing a query which may return way too much data.  For example:

    User types "513"
    Callback is initiated
    ItemsRequested server-side event fires
    SQL query executes and begins retrieving 25,000 records containing 513
    Meanwhile, user is typing the rest of the employee#, but the server is waiting on SQL

    I would like to make sure the ItemsRequested server-side event only fires when the user hits the Enter key after typing, is this possible?
  2. Aaron Gibbs
    Aaron Gibbs avatar
    23 posts
    Member since:
    Dec 2007

    Posted 27 Jan 2012 Link to this post

    *bump*  Anyone?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 30 Jan 2012 Link to this post

    Hi Aaron,

    A new request for items fires when the user types in the input area or clicks on the dropdown toggle image - in case there are no items in the RadComboBox.
    I am afraid that firing a request only upon “Enter” key pressing is not a supported scenario.

    However you can try using the MinFilterLength property. This property sets the minimum length of the typed text before the control initiates a request for new items.
    Please take a look at the “Load On Demand” section in the “ComboBox / Configurator” demo – please choose the “Custom” option there, set some value at the “Minimum filter length” input and observe the RadComboBox behaviour.

    All the best,
    Kalina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  5. Aaron Gibbs
    Aaron Gibbs avatar
    23 posts
    Member since:
    Dec 2007

    Posted 30 Jan 2012 Link to this post

    Thank you for the response.

    Is there a way I can mimic this behavior perhaps buy putting a button to trigger populating the dropdown instead?  

    I could place a button as the DefaultButton inside a panel containing the RadComboBox and button.  User can type in the RadComboBox and hit Enter, which fires an async postback on the button_Click event.  I can then use the button_click event's server-side code to populate the items collection of the RadComboBox.  Using this method, can I force the RadComboBox to be expanded when the postback completes?
  6. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 02 Feb 2012 Link to this post

    Hi Aaron,

    Load On Demand fires when the user types in the input area or clicks on the drop-down toggle image when there are no items in the RadComboBox.
    As I understand – you want to prevent this, and rice a request for items via another control (a button).

    I am afraid that changing the Load On Demand behaviour will affect the whole RadComboBox functioning. Maybe you will manage to implement your scenario without Load On Demand?

    In order to enable RadComboBox expand its dropdown when loaded – you can set the OpenDropDownOnLoad property to “true”.

    Greetings,
    Kalina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017