Rad Menu/getting Parent menu items text

2 posts, 1 answers
  1. deva subramanian
    deva subramanian avatar
    11 posts
    Member since:
    Jun 2012

    Posted 28 Jun 2012 Link to this post

    Hi Telerik,

    First of all thanks for supporting and providing answers for my  previous questions. i am facing difficulties in getting the parent menu items text. I have attached the image below, in which when i click on the 'Test Member4' i should get the Parent menu item text (ie) 'Test Member3' programatically. i dont know whether telerik allows as to achieve that?  please give the solution for the same.

    Note: all the menu items are dynamically created so i cant take any static text.

    Thanks in Advance.
  2. Answer
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 22 Jan 2013 Link to this post


    Try the following code snippet to achieve your scenario.

    void TestMember4_Click(object sender, EventArgs e)
          RadMenuItem item=(RadMenuItem)sender;
          RadMenuItem parent=(RadMenuItem)item.HierarchyParent; //getting the parent
          string s= parent.Text;

    Hope this helps.

  3. DevCraft R3 2016 release webinar banner
Back to Top