Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
190
Delay Webdropdown databind and limit results
posted

We are using wbdropdown to show a list of NDC medications. The user will select one and only one medication from the list. We are interested in the user having type-ahead functionality.

The master list is >24000 items which presents performance problems loading the page. can we delay binding of the webdropdown until the user has typed in 3 characters, and then use those 3 characters as a filter in the underlying query? How?

Thanks!

Parents
  • 49378
    posted

    Hi johnnvrsm,

    Thank you for posting in the community.

    You requirement may be achieved by handling the AutoFilterStarting clientside event which may be cancelled if the current value of the control is shorter than n characters. For instance:

    Code Snippet
    1. function WebDropDown1_AutoFilterStarting(sender, eventArgs)
    2. {
    3.     ///<summary>
    4.     ///
    5.     ///</summary>
    6.     ///<param name="sender" type="Infragistics.Web.UI.WebDropDown"></param>
    7.     ///<param name="eventArgs" type="Infragistics.Web.UI.DropDownEditEventArgs"></param>
    8.     if (eventArgs.get_value().length < 3) {
    9.         eventArgs.set_cancel(true);
    10.     }
    11.  
    12. }// -->

    Please note that you may also control the rate with which the items are filtered by modifying the AutoFilterTimeoutMs in order to defined the interval before a filtering request is sent to the server:

    http://help.infragistics.com/NetAdvantage/ASPNET/2011.2/CLR4.0/?page=Infragistics4.Web.v11.2~Infragistics.Web.UI.ListControls.WebDropDown~AutoFilterTimeoutMs.html

    Hope this helps.

Reply Children