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

How can I see a separator in the menu bar ?

1 Answer 131 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Michel
Top achievements
Rank 1
Michel asked on 17 Aug 2011, 02:53 PM

I use the MenuItem IsSeparator sucessfully in dropdown menus but the separator is not showing when used in the main menu bar...

<Menu>
   <MenuItem ... />
   <MenuItem IsSeparator="True" ... />
   <MenuItem ... />
</Menu>

EDIT: I added a default style for the menu item and it now displays a "horizontal" separator bar... How can I make this bar vertical ?

1 Answer, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 19 Aug 2011, 01:19 PM
Hello Michel,

Currently the RadMenuItem does not support orientation for the role Separator. By default, it has vertical orientation, i.e. it is meant for use in vertical scenarios. When using it as a horizontal separator, you will have to apply a small change to its template. For example, please consider the following snippet:

<Window.Resources
        <ControlTemplate x:Key="SeparatorTemplate" TargetType="telerik:RadMenuItem"
            <Grid HorizontalAlignment="Stretch">                 
                    <Rectangle Fill="Red" Height="20" Width="1" VerticalAlignment="Stretch"/> 
                    <Rectangle Fill="Blue" Height="20" Width="1" VerticalAlignment="Stretch"/>               
            </Grid
        </ControlTemplate>   
</Window.Resources>     
    
<Grid x:Name="LayoutRoot" Background="White"
        <telerik:RadMenu x:Name="radMenu" ClickToOpen="False" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="8,8,0,0"
            <telerik:RadMenuItem Header="File"/> 
            <telerik:RadMenuItem Header="Edit" IsSeparator="True" Template="{StaticResource SeparatorTemplate}" />              
            <telerik:RadMenuItem Header="View" />            
        </telerik:RadMenu
</Grid>

The above example displays a horizontal separator.

I hope this will give you some helpful insight on the issue.

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