RadDropDownButton in run-time

2 posts, 0 answers
  1. Karin
    Karin avatar
    6 posts
    Member since:
    Apr 2006

    Posted 17 Jul 2007 Link to this post

    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.

  2. Georgi
    Georgi avatar
    212 posts

    Posted 17 Jul 2007 Link to this post

    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,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top