Problem in createing dynamic menu

3 posts, 0 answers
  1. Bichitra
    Bichitra avatar
    34 posts
    Member since:
    Aug 2008

    Posted 22 Sep 2008 Link to this post


    I have another issue.

    I did not get any property  to get imediate parent RadmenuItem objectfrom the Child RadMenuItem object. 

    I was trying to store Parent RadMenuItem object to the child RadMenuItem object through Tag property.

    Ex:  RadMenuItem Item1 = new RadMenuItem(){Header="Item1"};
    RadMenuItem item2 = new2 RadMenuItem(){Headre="item2};
    item2.Tag= item1;

    And I have added the menuitem to theRadMenu.
    and when i was trying to show in Grid. it is giving  "SystemStack flow Exception" I I removed the tag property it working fine.

    Can you help to fix this issue. I am trying to build a menu  dynamically to read Xml file.

  2. Hristo
    Hristo avatar
    832 posts

    Posted 23 Sep 2008 Link to this post

    Hi Bichitra,

    With current version if RadMenuItem has been loaded you can use ItemsControl.ItemsControlFromItemContainer method. With next version of RadMenu you'll be able to use Parent property and cast it to RadMenuItem to get the ParentItem of some RadMenuItem (next version is scheduled till the end of week).

    Currently Silverlight 2 don't support adding UIElement that are in the visual tree to Tag property. That is why you get "StackOverflow exception".

    Why do you need parentMenuItem? What do you want to achieve?
    You can see example on how to create menu from XML in our online examples here:

    Kind regards,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. Bichitra
    Bichitra avatar
    34 posts
    Member since:
    Aug 2008

    Posted 23 Sep 2008 Link to this post


    Thanks for helping

    I am loading XML file on demand. I mean i am using webclient to download and  read xml file  using XmlReader to build Menu. I did the solution doing some work around using collection. I will try to use "ItemsControl.ItemsControlFromItemContainer "

Back to Top