This is a migrated thread and some comments may be shown as answers.

Do not dropdown on button click (DropDownButton)

3 Answers 89 Views
Buttons, RadioButton, CheckBox, etc
This is a migrated thread and some comments may be shown as answers.
Emmsa
Top achievements
Rank 2
Emmsa asked on 18 Dec 2009, 03:28 PM
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

3 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 19 Dec 2009, 12:40 PM
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.
0
Emmsa
Top achievements
Rank 2
answered on 19 Dec 2009, 05:32 PM
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"
0
Victor
Telerik team
answered on 21 Dec 2009, 10:21 AM
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.
Tags
Buttons, RadioButton, CheckBox, etc
Asked by
Emmsa
Top achievements
Rank 2
Answers by
Victor
Telerik team
Emmsa
Top achievements
Rank 2
Share this question
or