Which event to subcribe when user clicks on drop down list from textbox auto complete suggestions

4 posts, 0 answers
  1. Pratik
    Pratik avatar
    3 posts
    Member since:
    Jul 2010

    Posted 15 Oct 2012 Link to this post

    I have a RadTextBoxControl (or RadAutoCompleteBox). When the user types some text the drop down list of text suggetsions appears below. I want to capture the event when user clicks on one of the items from the list to select it. Which event should I subscribe to catch this. I also want to do the same if they tab out from the box.
  2. Svett
    Svett avatar
    728 posts

    Posted 18 Oct 2012 Link to this post

    Hi Pratik,

    You can handle when the user click on item from the auto-complete drop down list by handling the Click event in the following manner:
    this.radTextBoxControl1.ListElement.ElementTree.Control.Click += this.OnListElementClick;

    private void OnListElementClick(object sender, EventArgs e)
        ComponentThemableElementTree elementTree = this.radTextBoxControl1.ListElement.ElementTree;
        Point mousePosition = elementTree.Control.PointToClient(Control.MousePosition);
        RadElement element = elementTree.GetElementAtPoint(mousePosition);
        while (element != null)
            RadListVisualItem item = element as RadListVisualItem;
            if (item != null)
                // YOUR LOGIC HERE
            element = element.Parent;

    If you want to handle when the user press TAB key, you should subscribe for KeyDown event of RadTextBoxControl (RadAutoCompleteBox):
    this.radTextBoxControl1.KeyDown += new KeyEventHandler(radTextBoxControl1_KeyDown);

    private void radTextBoxControl1_KeyDown(object sender, KeyEventArgs e)
        if (e.KeyCode == Keys.Tab)
            // YOU LOGIC

    I hope this helps.
    the Telerik team
    You’ve been asking for it and now it’s time for us to deliver. RadControls for WinForms Q3 2012 release is just around the corner. Sign up for a free webinar to see first all the latest enhancements.
  3. DevCraft banner
  4. Anders
    Anders avatar
    4 posts
    Member since:
    Jan 2016

    Posted 29 Jan Link to this post

    RadAutoCompleteBox.ListElement does not exist, was this answer only about RadTextBoxControl?
  5. Dess
    Dess avatar
    1561 posts

    Posted 02 Feb Link to this post

    Hello Anders,

    Thank you for writing.

    The RadAutoCompleteBox.ListElement property is available in the latest official release Q1 2016. You can find attached a sample project demonstrating how to detect when the autocomplete popup is clicked.

    I hope this information helps. Should you have further questions I would be glad to help.

Back to Top