Hi friends,
How can we have a button with a dropdownmenu? How can we implement this?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Zoran HorvatRank #792 · 2.9K reputationPosted Aug 9, 2011, 12:39 AM EDT
You can always use ComboBox with DropDownStyle set to DropDownList. If you insist on having a proper button then you can show context menu from Click event. There are other possibilities as well - create your own control which would serve a dropdownmenu which you would prefer; then show this control in a splash window from Button.Click event. And so on... possibilities are endless.
Zoran
Prasant JinagaRank #2,383 · 594 reputationPosted Aug 9, 2011, 12:45 AM EDT
Can you please ellaborate your question a bit?
Thanks,
Prasant
B M SuchitraRank #2,922 · 492 reputationPosted Aug 9, 2011, 12:51 AM EDT
Zoran HorvatRank #792 · 2.9K reputationPosted Aug 9, 2011, 12:54 AM EDT
That is all you need and code is relatively simple.
Zoran
B M SuchitraRank #2,922 · 492 reputationPosted Aug 9, 2011, 1:35 AM EDT
I don`t want to open a new window. I want it in the same asp.net page. The button itself should act like a dropdown control when it is clicked
Zoran HorvatRank #792 · 2.9K reputationPosted Aug 9, 2011, 1:38 AM EDT
You can create a DIV and populate it with checkboxes, keeping it invisible. From button onClick event you would make it visible. Then make it invisible again when user clicks a checkbox, which is done from onValueChanged event of every checkbox.
Zoran
B M SuchitraRank #2,922 · 492 reputationPosted Aug 9, 2011, 2:21 AM EDT
That is how my boss requires.. Bit crazy but have to do it like that or else convice that guy
Zoran HorvatRank #792 · 2.9K reputationPosted Aug 9, 2011, 2:27 AM EDT
Avoid popping up new form from JavaScript or otherwise popup blockers might interfere.
Zoran