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

RadMenu background color

4 Answers 109 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Hunter
Top achievements
Rank 1
Hunter asked on 27 Apr 2012, 09:21 PM
I have a RadMenu two levels deep. I need to change the gray background color of the second level so the white text will be more visible against it (see attached screenshot). I have attempted to do this with the ItemContainerStyle, but something isn't working.

<telerik:RadMenu HorizontalAlignment="Stretch" Name="radMenu1" ItemContainerStyle="{StaticResource MenuItemStyle}" ItemsSource="{Binding TreeNode}" ItemClick="radMenu1_ItemClick" IconColumnWidth="0" Height="30" Foreground="White" Background="Transparent" FontSize="12" FontWeight="Bold" telerik:StyleManager.Theme="Vista">
    <telerik:RadMenu.ItemTemplate>
        <telerik:HierarchicalDataTemplate ItemsSource="{Binding Children}">
            <TextBlock Text="{Binding Value.Title}" />
        </telerik:HierarchicalDataTemplate>
    </telerik:RadMenu.ItemTemplate>
</telerik:RadMenu>

And here is the MenuItemStyle (I'm setting additional fields just to see if I can get something to change):

<Style x:Key="MenuItemStyle" TargetType="telerik:RadMenuItem">
    <Setter Property="Background" Value="red"/>
    <Setter Property="Foreground" Value="red"/>
    <Setter Property="FontSize" Value="20"/>
    <Setter Property="Height" Value="60" />
</Style>

This is having no visible effect. Any ideas?

4 Answers, 1 is accepted

Sort by
0
Accepted
Dani
Telerik team
answered on 30 Apr 2012, 09:45 AM
Hi Hunter,

Basic Style Setters in the ItemContainerStyle will change properties of the menu items, but what you wish to change is actually not the background of the menu item itself. It is the background of the Popup inside the RadMenuItem. For this you need the template.

You can generate the entire ItemContainerStyle from Expression Blend, find the TopLevelHeaderTemplate and change the background of the Popup. That background is determined by a Border and a Rectangle inside the Popup.

Hope this helps.

Kind regards,
Dani
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Hunter
Top achievements
Rank 1
answered on 30 Apr 2012, 07:15 PM
Thanks, Dani. It turns out that we're going to go in a different direction, but your answer will be helpful for future reference.
0
Kevin
Top achievements
Rank 1
answered on 02 May 2012, 01:58 PM
If you want to style a certain theme in Expression for a RadMenu how would you do that?  By default when I add a control it comes with the Office_Black styling.
0
Dani
Telerik team
answered on 03 May 2012, 09:26 AM
Hello Kevin,

Currently it is not possible to generate a theme other than the default Office Black theme in Expression Blend. In case you wish to edit another theme, you will have to manually copy the xaml from your local RadControls installation folder into your project.

A short description of the latest folders distributed with the installation as well as some useful details on the implicit styles and how to use them, can be found here.

I hope this helps.

Kind regards,
Dani
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
Menu
Asked by
Hunter
Top achievements
Rank 1
Answers by
Dani
Telerik team
Hunter
Top achievements
Rank 1
Kevin
Top achievements
Rank 1
Share this question
or