This topic goes through the key properties of the
By default, the RadContextMenu element displays a column used for visualizing the icons of the menu items.
Its width can be controlled through the
IconColumnWidth property. For example, it can be entirely hidden by setting the property value to 0.
Setting the IconColumnWidth property
Setting this property manipulates whether RadContextMenu will close automatically or not. Its default value is
False. By setting it to
True, the RadContextMenu control will stay open when the user clicks the menu items.
RadContextMenu provides a mechanism for controlling the horizontal distance between the target origin and the popup alignment point through the
Setting the HorizontalOffset property
RadContextMenu can be opened only when a specific event is raised.
EventName is the property through which the given event can be pointed to.
ModifierKey property is used in conjunction with the
EventName one. It is used when opening RadContextMenu only for a specific event is needed, but with a specified modifier key pressed as well. It is an enumeration type and has the following values.
MousePosition property provides information regarding the position of the mouse at the moment when the menu was opened relative to the element that caused its opening. It returns a
Returns the instance of the element to which RadContextMenu is attached.
Similarly to the
HorizontalOffset property, the
VerticalOffset one provides a mechanism for setting the vertical distance between the target origin and the popup alignment point.
By default, the RadContextMenu inherits the DataContext of its parent element. If you want to avoid that, you can set the
InheritDataContext property to
When opened the RadContextMenu automatically gets the focus. To automatically return the focus back to the parent element that opened the context menu when the menu gets closed, set the
RestoreFocusToTargetElement property to
Setting the RestoreFocusToTargetElement property
ShowKeyboardCuesOnOpen property allows you to control the visibility of the keyboard cues, when the RadContextMenu element is opened. The default value of this property is
null. This means that the set access keys will automatically show when the menu is opened through the keyboard. Setting this property to
true will always visualize the modifier keys when the RadContextMenu is opened through the keyboard or via a mouse. If the property is set to
false the keyboard cues will not be shown.
By setting the
true, there will be no need to hold the
Altkey when the RadContextMenu is opened via a mouse.