title: WPF Telerik RadContextMenu and RadMenuItem:How to remove extra highlighted row from RadMenuItem
body: <p><em>RadMenuItem</em></p>
  
  <p><strong>RadMenuItem is used to present menu</strong></p>
  
  <pre><code> &lt;Style TargetType="{x:Type telerik:RadMenuItem}"&gt;
      &lt;Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" /&gt;
      &lt;Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" /&gt;
      &lt;Setter Property="Background" Value="{StaticResource ContextMenuBackground}"/&gt;
      &lt;Setter Property="Foreground" Value="{StaticResource ContextMenuForeground}"/&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type telerik:RadMenuItem}"&gt;
                  &lt;Grid&gt;
                      &lt;Grid.RowDefinitions&gt;
                          &lt;RowDefinition Height="*"/&gt;
                          &lt;RowDefinition /&gt;
                      &lt;/Grid.RowDefinitions&gt;
  
                      &lt;Border x:Name="Border"
                          Background="{TemplateBinding Background}"
                          BorderBrush="{TemplateBinding Background}"
                          BorderThickness="2"
                          CornerRadius="5"&gt;
  
                          &lt;Grid&gt;
                              &lt;Grid.ColumnDefinitions&gt;
                                  &lt;ColumnDefinition Width="Auto"
                                                MinWidth="17"
                                                SharedSizeGroup="Icon" /&gt;
                                  &lt;ColumnDefinition Width="Auto" MinWidth="5"
                                                SharedSizeGroup="Name" /&gt;
                                  &lt;ColumnDefinition MinWidth="5" Width="Auto" 
                                                SharedSizeGroup="Shortcut" /&gt;
  
                                  &lt;ColumnDefinition MinWidth="10" Width="Auto" 
                                                SharedSizeGroup="Arrow" /&gt;
                              &lt;/Grid.ColumnDefinitions&gt;
  
  
                              &lt;ContentPresenter x:Name="Icon"
                                            Margin="4,0,6,0"
                                            VerticalAlignment="Center"
                                            ContentSource="Icon" /&gt;
  </code></pre>
  
  <p><em>this piece of code is used to override the menuitem style and set foreground property</em></p>
  
  <pre><code>                            &lt;ContentPresenter x:Name="HeaderHost"
                                            Grid.Column="1"
                                            Margin="{TemplateBinding Padding}"
                                            ContentSource="Header"
                                            RecognizesAccessKey="True" &gt;
  
                                  &lt;ContentPresenter.Resources&gt;
                                          &lt;Style TargetType="{x:Type TextBlock}"&gt;
                                              &lt;Setter Property="TextTrimming" Value="CharacterEllipsis"/&gt;
                                              &lt;Setter Property="FontSize" Value="11"/&gt;
                                              &lt;Setter Property="FontFamily" Value="Arial Unicode MS"/&gt;
                                              &lt;Style.Triggers&gt;
                                                  &lt;Trigger Property="controls:TextBlockService.IsTextTrimmed" Value="True"&gt;
                                                      &lt;Setter Property="ToolTip" Value="{Binding Text, RelativeSource={RelativeSource Self}}"/&gt;
                                                  &lt;/Trigger&gt;
                                              &lt;/Style.Triggers&gt;
                                          &lt;/Style&gt;
  
                                  &lt;/ContentPresenter.Resources&gt;
                                  &lt;/ContentPresenter&gt;
  
  
  
  
  
  
  
                              &lt;TextBlock x:Name="ShortCuts" Grid.Column="3" Margin="{TemplateBinding Padding}" &gt;
                              &lt;/TextBlock&gt;
  
  
  
  
  
                              &lt;Popup x:Name="SubMenuPopup"
                                 AllowsTransparency="true"
                                 Focusable="false" Grid.IsSharedSizeScope="True"
                                 IsOpen="{Binding Path=IsSubmenuOpen,
                                                  RelativeSource={RelativeSource TemplatedParent}}"
                                 Placement="Right"
                                 PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}"
                                 VerticalOffset="-3"&gt;
                                  &lt;Grid x:Name="SubMenu"&gt;
                                      &lt;Border x:Name="SubMenuBorder"
                                          Background="{TemplateBinding Background}"
                                          BorderBrush="Gray"
                                          BorderThickness="1" 
                                          CornerRadius="5"&gt;
                                          &lt;StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" /&gt;
                                      &lt;/Border&gt;
                                  &lt;/Grid&gt;
                              &lt;/Popup&gt;
                          &lt;/Grid&gt;
                      &lt;/Border&gt;
  </code></pre>
  
  <p><em>this separator property is set, because of this property i am getting on extra row in the Rad Menu Item</em></p>
  
  <pre><code>                    &lt;Rectangle x:Name="Separator" Grid.Row="1" 
                                  Height="1" Visibility="Collapsed"  
                                  Fill="{DynamicResource GridView_GridLinesItemVertical}" /&gt;
  
  
  
  
  
  
                  &lt;/Grid&gt;
                  &lt;ControlTemplate.Triggers&gt;
                      &lt;Trigger Property="attachedBehaviors:MenuItemHasSeparatorBehavior.HasSeparator" Value="True"&gt;
                          &lt;Setter TargetName="Separator" Property="Visibility" Value="Visible"/&gt;
                      &lt;/Trigger&gt;
  
                      &lt;Trigger Property="Role" Value="TopLevelHeader"&gt;
                          &lt;Setter Property="Margin" Value="2" /&gt;
                          &lt;Setter Property="Padding" Value="6,3,6,3" /&gt;
                          &lt;Setter TargetName="SubMenuPopup" Property="Placement" Value="Bottom" /&gt;
  
  
                      &lt;/Trigger&gt;
  
                      &lt;Trigger Property="Role" Value="TopLevelItem"&gt;
                          &lt;Setter Property="Margin" Value="2" /&gt;
                          &lt;Setter Property="Padding" Value="6,3,6,3" /&gt;
  
                      &lt;/Trigger&gt;
  
                      &lt;Trigger Property="Role" Value="SubmenuHeader"&gt;
                          &lt;Setter Property="DockPanel.Dock" Value="Top" /&gt;
                          &lt;Setter Property="Padding" Value="0,2,0,2" /&gt;
  
  
                      &lt;/Trigger&gt;
  
                      &lt;Trigger Property="Role" Value="SubmenuItem"&gt;
                          &lt;Setter Property="DockPanel.Dock" Value="Top" /&gt;
                          &lt;Setter Property="Padding" Value="0,2,0,2" /&gt;
  
                      &lt;/Trigger&gt;
  
  
  
  
                      &lt;Trigger Property="Icon" Value="{x:Null}"&gt;
                          &lt;Setter TargetName="Icon" Property="Visibility" Value="Collapsed" /&gt;
                      &lt;/Trigger&gt;
  
                      &lt;Trigger Property="IsChecked" Value="true"&gt;
                          &lt;Setter TargetName="Icon" Property="Visibility" Value="Collapsed" /&gt;
                      &lt;/Trigger&gt;
  
                      &lt;Trigger SourceName="SubMenuPopup" Property="AllowsTransparency" Value="true"&gt;
                          &lt;Setter TargetName="SubMenu" Property="Margin" Value="2" /&gt;
                          &lt;Setter TargetName="SubMenu" Property="SnapsToDevicePixels" Value="true" /&gt;
                          &lt;Setter TargetName="SubMenuBorder" Property="BitmapEffect" Value="{DynamicResource PopupDropShadow}" /&gt;
                      &lt;/Trigger&gt;
  
  
  
  
                      &lt;Trigger Property="IsHighlighted" Value="true"&gt;
                          &lt;Setter TargetName="Border" Property="Background" Value="{StaticResource BR_Menu_Highlight}" /&gt;
                          &lt;Setter Property="Foreground" Value="{StaticResource BR_SE_White}" /&gt;
                          &lt;Setter TargetName="ShortCuts" Property="Foreground" Value="{StaticResource BR_SE_White}" /&gt;
  
  
                      &lt;/Trigger&gt;
                      &lt;Trigger Property="IsEnabled" Value="false"&gt;
                          &lt;Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" /&gt;
                          &lt;Setter TargetName="ShortCuts" Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/&gt;
                      &lt;/Trigger&gt;
                  &lt;/ControlTemplate.Triggers&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p><em>RadContextMenu</em></p>
  
  <pre><code> &lt;Style TargetType="{x:Type telerik:RadContextMenu}"&gt;
      &lt;Setter Property="OverridesDefaultStyle" Value="True" /&gt;
      &lt;Setter Property="SnapsToDevicePixels" Value="True" /&gt;
      &lt;Setter Property="Background" Value="{StaticResource ContextMenuBackground}"/&gt;
      &lt;Setter Property="FontSize" Value="11"/&gt;
      &lt;Setter Property="FontFamily" Value="Arial Unicode MS"/&gt;
  
      &lt;Setter Property="Grid.IsSharedSizeScope" Value="True"&gt;&lt;/Setter&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type telerik:RadContextMenu}"&gt;
  
  
  
  
                  &lt;Border x:Name="Border"
                          Background="{TemplateBinding Background}"
                          BorderBrush="{StaticResource ContextMenuBorderBrush}"
                          BorderThickness="1"
                          CornerRadius="5"&gt;
  
  
  
  
                      &lt;StackPanel ClipToBounds="True"
                                  IsItemsHost="True"
  
  
                          Orientation="Vertical" /&gt;
                  &lt;/Border&gt;
              &lt;/ControlTemplate&gt;
  
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>