Select Top Item On Field Exit / Tab

4 posts, 0 answers
  1. Seth
    Seth avatar
    66 posts
    Member since:
    Oct 2009

    Posted 26 Feb 2013 Link to this post

    Is there a way to have the RadAutoCompleteBox select the top most item when the user tabs out of the field?  
  2. Bozhidar
    Admin
    Bozhidar avatar
    1103 posts

    Posted 01 Mar 2013 Link to this post

    Hello Seth,

    You can try the following code:
    var originalHandler = Telerik.Web.UI.RadAutoCompleteBox.prototype._onBlur;
    Telerik.Web.UI.RadAutoCompleteBox.prototype._onBlur = function(e) {
        if (!this._dropDown._shouldBlurAutoComplete) {
            return;
        }
                 
        var item = this._dropDown.getItem(0);
                 
        if (item) {
            this.get_inputElement().value = "";
            this._addEntryFromItem(item);
        }
                 
        originalHandler.apply(this, [e]);
    }

     

    Kind regards,
    Bozhidar
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jason
    Jason avatar
    22 posts
    Member since:
    Sep 2007

    Posted 19 Jul 2013 Link to this post

    Along these same lines, is it possible to select the highlighted item if a user tabs out of the AutoCompleteBox. For instance, if a user uses the arrow keys on the keyboard to select a different item and then hits the tab key?
  5. Bozhidar
    Admin
    Bozhidar avatar
    1103 posts

    Posted 22 Jul 2013 Link to this post

    Hello Jason,

    This functionality has just been released and you can see it in action in our demos:
    http://demos.telerik.com/aspnet-ajax/autocompletebox/examples/default/defaultcs.aspx

     

    Regards,
    Bozhidar
    Telerik
    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 the blog feed now.
Back to Top