Do not dropdown on button click (DropDownButton)

4 posts, 0 answers
  1. Emmsa
    Emmsa avatar
    56 posts
    Member since:
    Oct 2006

    Posted 18 Dec 2009 Link to this post

    Hi there!

    I´d need to do some action when I click on a DropDownButton (not the arrow) and I do not want that de DropDownButton shows its menu.
    How can I get this result?

    Regards
    Darío K
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 19 Dec 2009 Link to this post

    Hi Darío K,

    You need to use RadSplitButton instead of RadDropDownButton.

    Kind regards,
    Victor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Emmsa
    Emmsa avatar
    56 posts
    Member since:
    Oct 2006

    Posted 19 Dec 2009 Link to this post

    I`d like to make it a little more dynamic. Somethink like "If the button has one item execute it, else simple shows the menu"
  5. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 21 Dec 2009 Link to this post

    Hello Darío K,

    You can implement this by subscribing to DropDownOpening event and canceling it if the button contains only one item. For example:

    private void radDropDownButton1_DropDownOpening(object sender, EventArgs e)
    {
        RadPopupOpeningEventArgs args = (RadPopupOpeningEventArgs)e;
        args.Cancel = true; // if RadDropDownButton has only one item.
    }

    Please write again if you need further assistance.

    Best wishes,

    Victor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top