2 posts, 0 answers
  1. Erik
    Erik avatar
    80 posts
    Member since:
    Jul 2007

    Posted 30 Jul 2008 Link to this post

    Hi Telerik,

    I added RadDropDownMenu to every node in tree view.

    dim MenuItem1 as new Telerik.Wincontrols.UI.RadMenuItem
    dim MenuItem2 as new Telerik.Wincontrols.UI.RadMenuItem

    MenuItem1.text="Test Drop Down Menu1"

    MenuItem2.text="Test Drop Down Menu2"

    My question is how to get the index of the MenuItem1 or MenuItem2 when you click the RadDropDownMenu?


  2. Jordan
    Jordan avatar
    547 posts

    Posted 01 Aug 2008 Link to this post

    Hi Erik,

    If you look at the code of the RadTreeView context menu example in the Quick-Start application you will notice the following method:
    private void radMenuItem_Click(object sender, EventArgs e) 
                RadMenuItem item = sender as RadMenuItem; 
                if (item != null
                    label3.Text = this.clickedNode; 
                    label4.Text = item.Text; 

    Here, the important part is that the sender is actually the menu item, so you can use it to find its index in the Items collection of the menu (using the IndexOf method).

    Hope that helps.

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top