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

RadDropDownButton in run-time

1 Answer 76 Views
Buttons, RadioButton, CheckBox, etc
This is a migrated thread and some comments may be shown as answers.
Karin
Top achievements
Rank 1
Karin asked on 17 Jul 2007, 05:41 AM
Hi All,

I'm trying to populate RadDropDownButton items in run-time and create a generic handler for their Click event. Through the examples in the documentation I can create the RadMenuItem's dynamically. However, I can't seem to find any documentation on how to get to the Click event of the RadMenuItems.

To give a bit of an example of what I want to achieve I did something similar with a normal windows menu where the sub menu items were dynamic.

So the sub menu items were set up using 
MI_Reports.MenuItems.Add(items(i).Name, New System.EventHandler(AddressOf openReport_Click))  
 

and their Click events are handled by something along these lines
Private Sub openReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click  
 

Hopefully that makes sense to someone. Any hints or pointers of how else I could do this would be greatly appriciated.

Cheers,
Karin

1 Answer, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 17 Jul 2007, 04:00 PM
Hello Karin,

We have designed the RadDropDownButton (as well as RadMenu) to support click events only for its RadMenuItems. By design, there is no way to handle click events on a control level.

In your case, if you add RadMenuItems dynamically or at design-time, you should attach a Click event to every menu item separately. Perhaps you could attach to the RadMenuItem.Click event of every menu item you create and add at runtime.

If you have any additional questions, please don't hesitate to write us.

 
Sincerely yours,
Georgi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Buttons, RadioButton, CheckBox, etc
Asked by
Karin
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Share this question
or