RadAutoCompleteBox filter callback misses letters that are entered after it sends the callback for first letter.

4 posts, 1 answers
  1. Jameson
    Jameson avatar
    2 posts
    Member since:
    Aug 2016

    Posted 23 Aug Link to this post

    RadAutoCompleteBox comes back with the wrong filtered result set when typing into the textbox. It seems to be doing the filtering on the first letter I'm typing, but then ignoring the second letter I've typed. For example, if I start to type the word "test" it will start filtering the auto complete box for "t" or "te", but ignore the rest of the word. It seems to be doing the filtering if i very briefly pause (split second) and that's why it's not picking up the whole word. If I hit backspace, then it does a callback and the filtered result set is accurate. Is there a built in way to delay the filtering so it only does the callback after I've stopped typing for one second? Thanks in advance for the help.

     

    Here's the code:

    <telerik:radautocompletebox id="txtSearch" runat="server" oncliententryadding="OnClientEntryAddingHandler" emptymessage="FIND AN ACCOUNT or TPID"
                                        autopostback="true" onentryadded="autocomplete_EntryAdded" filter="Contains" datavaluefield="TPID" datatextfield="AccountName" 
                                        cssclass="searchtext" width="275px" DropDownAutoWidth="Enabled" maxresultcount="10">
                                </telerik:radautocompletebox>

  2. Answer
    Ivan Danchev
    Admin
    Ivan Danchev avatar
    829 posts

    Posted 26 Aug Link to this post

    Hello Jameson,

    If you want to delay the filtering you can consider using one of the two approaches explained below or both:

    1. The search can be prevented until the user enters the required number of characters by setting the MinFilterLength property (for instance MinFilterLength="3"). Using your example, the user would have to enter "tes" in order for the search to be initiated.
    2. The search can be delayed. You can subscribe the AutoCompleteBox to its OnClientLoad event (OnClientLoad="OnClientLoad") and in its handler set a delay in milliseconds:
    function OnClientLoad(sender) {
        sender.set_requestDelay(1000);
    }

    set_requestDelay() and other important client-side methods are listed in the following documentation article.

    Regards,
    Ivan Danchev
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jameson
    Jameson avatar
    2 posts
    Member since:
    Aug 2016

    Posted 26 Aug in reply to Ivan Danchev Link to this post

    Thank you for your help! This works great. I was trying to use the set_requestDelay(), but was putting it in the wrong event - OnClientEntryAdding.
  5. Ivan Danchev
    Admin
    Ivan Danchev avatar
    829 posts

    Posted 29 Aug Link to this post

    Hello Jameson,

    I am glad it worked out. The OnClientLoad event handler is the right place to call the method, because the OnClientEntryAdding event fires after the request is sent.

    Regards,
    Ivan Danchev
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top