This is a migrated thread and some comments may be shown as answers.

[Solved] Applying RadMenuItem styles to entire "tree" of RedMenuItem's

1 Answer 143 Views
Menu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rob
Top achievements
Rank 1
Rob asked on 30 Jan 2009, 06:52 PM
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>

 

 

 

          <

TelerikNavigationControls:RadMenuItem Header="1.2" />

 

 

 

          <

TelerikNavigationControls:RadMenuItem Header="1.3" />

 

 

     </TelerikNavigationControls:RadMenuItem>

 

 

     <

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

 

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

 

</TelerikNavigationControls:RadMenu>

 

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 02 Feb 2009, 11:36 AM
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.

Regards,
Hristo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Menu
Asked by
Rob
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or