Keyboard Support
The ModifierKey property allows you to use a modifier key, which in combination with the mouse action opens the RadContextMenu. When setting the ModifierKey property you can choose among several available values:
-
Alt - specifies that the Alt button must be pressed, in order to open the RadContextMenu.
-
Apple - specifies that the Apple button must be pressed, in order to open the RadContextMenu.
-
Control - specifies that the Control button must be pressed, in order to open the RadContextMenu.
-
None - specifies that none of the buttons must be pressed, in order to open the RadContextMenu. (default)
-
Shift - specifies that the Shift button must be pressed, in order to open the RadContextMenu.
-
Windows - specifies that the Windows button must be pressed, in order to open the RadContextMenu.
Here is an example of a RadContextMenu that requires the Control button to be pressed in order to open.
Require a Modifier Key
<TextBox xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Width="200"
VerticalAlignment="Top">
<telerik:RadContextMenu.ContextMenu>
<telerik:RadContextMenu ModifierKey="Control">
<!-- Add menu items here. -->
</telerik:RadContextMenu>
</telerik:RadContextMenu.ContextMenu>
</TextBox>
If you run your application and just right-click the TextBox control, nothing will happen. The combination of holding the "Control" key and then right-clicking the button actually opens the RadContextMenu.
Show Keyboard Cues
The ShowKeyboardCuesOnOpen property controls the visibility of keyboard cues when the RadContextMenu opens. Its default value is null, which shows access keys when the menu is opened through the keyboard. Set it to True to always show keyboard cues, or to False to hide them.
Show Keyboard Cues When Opening
<telerik:RadContextMenu xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
ShowKeyboardCuesOnOpen="True" />
Setting ShowKeyboardCuesOnOpen to True removes the need to hold the Alt key when the RadContextMenu is opened with the mouse.