Remove indentation of RedMenuItem and change its color

2 posts, 0 answers
  1. Weimin
    Weimin avatar
    1 posts
    Member since:
    May 2012

    Posted 29 May 2012 Link to this post

    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>

    - 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?
  2. Dani
    Dani avatar
    848 posts

    Posted 30 May 2012 Link to this post

    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.

    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft R3 2016 release webinar banner
Back to Top