Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Menu > How can I see a separator in the menu bar ?

Not answered How can I see a separator in the menu bar ?

Feed from this thread
  • Michel avatar

    Posted on Aug 17, 2011 (permalink)

    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 ?

    Reply

  • Dani Dani admin's avatar

    Posted on Aug 19, 2011 (permalink)

    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 >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Menu > How can I see a separator in the menu bar ?