RadAutoCompleteBox and doubleclick

2 posts, 1 answers
  1. Giovanni
    Giovanni avatar
    37 posts
    Member since:
    Feb 2011

    Posted 23 Nov 2012 Link to this post

    Hi,
    I'm trying to use RadAutoCompleteBox with AutoCompleteMode=Suggested (see the Telerik demo application).
    It works fine, but if I do a double click on a suggested item it will be inserted in the textbox 2 times, the first as element and the second as simple text.
    Is this a known issue of the control?
    Is there any way to fix it?

    Thank you.
  2. Answer
    Svett
    Admin
    Svett avatar
    728 posts

    Posted 27 Nov 2012 Link to this post

    Hi Giovanni,

    Thank you for writing.

    I managed to reproduce the issue. I logged it in our public issue tracking system. It will be addressed in one of the next releases. Meanwhile, you should use the following work around:
    public class MyRadAutoCompleteBox : RadAutoCompleteBox
        {
            public MyRadAutoCompleteBox()
            {
                this.ThemeClassName = typeof(RadAutoCompleteBox).FullName;
            }
     
            protected override RadTextBoxControlElement CreateTextBoxElement()
            {
                return base.CreateTextBoxElement();
            }
        }
     
    public class MyRadAutoCompleteBoxElement : RadAutoCompleteBoxElement
        {
            protected override System.Type ThemeEffectiveType
            {
                get
                {
                    return typeof(RadAutoCompleteBoxElement);
                }
            }
     
            protected override RadPopupControlBase CreateAutoCompleteDropDown()
            {
                return base.CreateAutoCompleteDropDown();
            }
        }
     
    public class MyRadTextBoxAutoCompleteDropDown : RadTextBoxAutoCompleteDropDown
        {
            public MyRadTextBoxAutoCompleteDropDown(RadTextBoxControlElement element)
                : base(element)
            {
     
            }
     
            protected override void OnMouseUp(MouseEventArgs e)
            {
                if (!PopupManager.Default.ContainsPopup(this))
                {
                    return;
                }
     
                base.OnMouseUp(e);
            }
        }

    I updated your Telerik points.

    Greetings,
    Svett
    the Telerik team
    Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top