Applying RadMenuItem styles to entire "tree" of RedMenuItem's

2 posts, 0 answers
  1. Rob
    Rob avatar
    238 posts
    Member since:
    Jan 2009

    Posted 30 Jan 2009 Link to this post

    How do I apply a RadMenuItem style to all items in a RadMenu regardless of the depth?  By applying the "ItemsContainerStyle" at the root, it only seems to style elements at the first level.  I can get around this problem by applying the style at each sub item but that doesn't seem like the proper way to do it.

    For example: 


    TelerikNavigationControls:RadMenu Style="{StaticResource rm}" ItemContainerStyle="{StaticResource rmi}">



         <TelerikNavigationControls:RadMenuItem Header="1" >


              <TelerikNavigationControls:RadMenuItem Header="1.1">




                   <TelerikNavigationControls:RadMenuItem Header="1.1.1" />




                   <TelerikNavigationControls:RadMenuItem Header="1.1.2" />




                   <TelerikNavigationControls:RadMenuItem Header="1.1.3" />









    TelerikNavigationControls:RadMenuItem Header="1.2" />





    TelerikNavigationControls:RadMenuItem Header="1.3" />







    TelerikNavigationControls:RadMenuItem Header="2" ItemContainerStyle="{StaticResource rmi}" />


         <TelerikNavigationControls:RadMenuItem Header="3" ItemContainerStyle="{StaticResource rmi}" />




  2. Hristo
    Hristo avatar
    832 posts

    Posted 02 Feb 2009 Link to this post

    Hello Rob,

    The idea of ItemContainerStyle property is to be used when you bind the ItemsControl to some data source. This way you can modify the container through the Style.
    If you have the containers (menuItems) then there is no problems to modify them. Using ItemContainerStyle to change the Style of explicitly generated MenuItems is not a supported scenario. You should set their Style property explicitly or use an Application theme.

    Let me know if you need more help.

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft R3 2016 release webinar banner
Back to Top