DropDown List open as soon as it has focus

5 posts, 1 answers
  1. Helen
    Helen avatar
    101 posts
    Member since:
    Nov 2008

    Posted 10 Feb 2015 Link to this post

    Hi folks,

    Is there any way to have the WinForms DropDownList control automatically drop down as soon as it has the focus?

    Thx

    Helen
  2. Answer
    Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 11 Feb 2015 Link to this post

    Hi Helen,

    Thank you for writing.

    You can do that by capturing the GotFocus event and in it call the control's ShowDropDown menu:
    void radDropDownList1_GotFocus(object sender, EventArgs e)
    {
        radDropDownList1.ShowDropDown();
    }

    I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Helen
    Helen avatar
    101 posts
    Member since:
    Nov 2008

    Posted 11 Feb 2015 in reply to Stefan Link to this post

    Perfect! Just what I need!
  5. Helen
    Helen avatar
    101 posts
    Member since:
    Nov 2008

    Posted 11 Feb 2015 in reply to Helen Link to this post

    Um ... I'm not seeing a GotFocus event in the properties window?
  6. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 11 Feb 2015 Link to this post

    Hi Helen,

    GotFocus comes from the Control class and it is defined as Browsable(false), hence this event is not visible in the events list. You can subscribe to it with code:
    radDropDownList1.GotFocus+=radDropDownList1_GotFocus;

    I hope this helps.

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for WinForms is Visual Studio 2017 Ready