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

Remove indentation of RedMenuItem and change its color

1 Answer 83 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.
Weimin
Top achievements
Rank 1
Weimin asked on 29 May 2012, 07:17 PM
I used Red Menu Items created a layered menu by the following code:

>        <telerik:RadMenu Height="18"
>                         Margin="6 0 0 0"
>                         BorderThickness="0"
>                         Foreground="{StaticResource ForegroundBrush}"
>                         Background="{StaticResource BackgroundBrush}" >
>                <telerik:RadMenuItem Header="Export"
>                                     BorderBrush="{StaticResource ForegroundBrush }"
>                                     Margin="-1 -3 0 0"
>                                     BorderThickness="1"
>                                     Height="23" >
>                       <telerik:RadMenuItem Header="Current View"
>                                            Command="{Binding myCurrentViewFunc}"
>                                            Foreground="{StaticResource ForegroundBrush}"
>                                            Background="{StaticResource BackgroundBrush}" />
>                       <telerik:RadMenuItem Header="Full Dump"
>                                            Command="{Binding myFullDumpFunc}"
>                                            Foreground="{StaticResource ForegroundBrush}"
>                                            Background="{StaticResource BackgroundBrush}" />
>               </telerik:RadMenuItem>
>        </telerik:RadMenu>

Questions:
- Is it possible to remove the indentaiton at the beginning of each sub menu items?
- How to change the highlight color when mouse is over a menu item?

1 Answer, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 30 May 2012, 09:18 AM
Hi Weimin,

The indent you are redering to is actually the space of the column reserved for icons. RadMenu has an IconColumnWidth property which you can set to zero in order to hide the indentation.

The mouse over effect as well as all states visuals of the menu items are presented by a ButtonChrome control in the RadMenuItem template. If you wish to modify the mouse over or any other visual, you should generate the ItemContainerStyle of RadMenu in Blend. Then find the button chrome named SelectionChrome and generate its Style. Modify that style and its brushes to customize the appearance of RadMenuItem visual states.
This process is described for RadComboBox in this online article. Basically the approach is the same.

Hope this information will be helpful.

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