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

How does one turnoff highlight on RadMenu?

3 Answers 173 Views
Menu
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 15 Aug 2013, 05:24 PM
This may be a backwards inquiry, but how do I remove the highlight from a MenuItem?

I'm using RadMenu to create a dropdown for a global search field.  The parent level displays a vector-path icon, clicking it drops down the menu with a RadWatermarkTextBox and RadButton on one line and a Checkbox/TextBlock on the next.  Works great (attached-Search1.png)!  The only thing is the undesirable highlight on the mouseover (attached-Search2.png).  Is there a XAML attribute I can apply?

Below is the current XAML code I'm using:


<telerik:RadMenu HorizontalAlignment="Left"
Background="{StaticResource MainBrush}"
Orientation="Horizontal"
Padding="0"
Height="33"
Margin="0 0 0 0"
VerticalAlignment="Top"
ClickToOpen="True"
IconColumnWidth="0">
<telerik:RadMenuItem StaysOpenOnClick="True"
Foreground="{StaticResource MarkerBrush}">
<telerik:RadMenuItem.Icon>
<CustomShape:CustomShape Style="{StaticResource GlobalSearch}"
Margin="0 0 0 0" />
</telerik:RadMenuItem.Icon>

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal">
<telerik:RadWatermarkTextBox Grid.Row="0"
Grid.Column="0"
Height="24"
Margin="-2 2 0 2"
VerticalAlignment="Center"
SelectionOnFocus="SelectAll"
WatermarkContent="{Binding Labels[GlobalSearch]}"
Text="{Binding GlobalSearchString, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Events:EventToCommandBehavior.Command="{Binding GlobalSearchTextKeyDown}"
Events:EventToCommandBehavior.Event="KeyDown"
Width="130" />
<telerik:RadButton Grid.Row="0"
  Grid.Column="1"
  VerticalAlignment="Center"
  Margin="4 0 -2 0"
  Height="24"
  Command="{Binding GlobalSearchCommand}"
  IsEnabled="{Binding SearchButtonEnabled, Mode=TwoWay}"
  Style="{StaticResource SearchButton}" />
</StackPanel>
<CheckBox Grid.Row="1"
 Grid.Column="0"
 Grid.ColumnSpan="2"
 Margin="-3,4,0,0"
 VerticalAlignment="Center"
 IsChecked="{Binding WholeWordsOnly, Mode=TwoWay}">
<TextBlock TextWrapping="Wrap"
  Text="{Binding Labels[WholeWordsOnly]}"
  FontSize="9.333"
  VerticalAlignment="Center"
  HorizontalAlignment="Center"
  Margin="0,2,0,0" />
</CheckBox>
</Grid>
</telerik:RadMenuItem>
</telerik:RadMenu>


Thank you much,
John

3 Answers, 1 is accepted

Sort by
0
Polya
Telerik team
answered on 16 Aug 2013, 02:34 PM
Hello John,

Since Q2 2013 we released the new RadMenuGroupItem that plays the role of a container item inside a RadMenu or RadContextMenu. RadMenuGroupItem handles focus, navigation, key and mouse events differently than RadMenuItem and we can put multiple controls in the RadMenuGroupItem and achieve the desired effect. I've attached a sample project that demonstrates that.

You can find another example that demonstrates RadMenuGroupItem here.

Hopefully this helps. Feel free to contact us in case you have any problems or concerns.

Regards,
Polya
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
John
Top achievements
Rank 1
answered on 16 Aug 2013, 05:46 PM
Hi Polya,

Thanks for the expedient reply, but I'm still at a loss.  I anxiously tried your suggestion but I'm getting the reply, "The name 'RadMenuGroupItem' does not exist in the namespace 'http://schemas.telerik.com/2008/xaml/presentation'."

This was the case with both Visual Studio and Expression Blend.  With both the sample you sent, as well as pulling sample code from the online "DropdownButton Integration" reference you cited.  I didn't see anything within the code that would allude to controlling the highlight, or am I to assume it automatically built into the RadMenuGroupItem container?

Thanks,
John
0
Rosen Vladimirov
Telerik team
answered on 20 Aug 2013, 07:54 AM
Hi John,

RadMenuGroupItem is available since our 2013 Q2 release. May I ask you which version of RadControls are you using?

As for the mentioned highlighting, as my colleague Polya described, when you put UI elements inside RadMenuItem, they are wrapped in another RadMenuItem container. So the whole Grid, that you are using, is used as a Header of a RadMenuItem and that's why when you mouse over it, all of it is highlighted. In order to prevent this generation of RadMenuItem's container, we have introduced RadMenuGroupItem. UI elements inside RadMenuGroupItem are not changed and wrapped inside another container, so you will not see the highlighted state. I'm sending you an image demonstrating the difference between the usage of RadMenuItem and RadMenuGroupItem. I'm also sending you the test project again. You should be able to run it, as I've included needed dlls in the archive.

Hopefully this helps. Feel free to contact us in case you have any problems or concerns.

Regards,
Rosen Vladimirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Menu
Asked by
John
Top achievements
Rank 1
Answers by
Polya
Telerik team
John
Top achievements
Rank 1
Rosen Vladimirov
Telerik team
Share this question
or