Class RadContextMenuManager
Provides a component that adds the RadContextMenu dynamic property to controls and enables using RadContextMenu with any control that supports context menus. This manager handles the association between controls and their context menus.
Inheritance
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
[TelerikToolboxCategory("Menus & Toolbars")]
public class RadContextMenuManager : Component, IExtenderProvider
Constructors
RadContextMenuManager()
Declaration
public RadContextMenuManager()
Methods
CanExtend(Object)
Determines whether this extender provider can extend the specified target component with context menu functionality. This method excludes RadTreeView and RadTextBoxControl as they have their own context menu implementations.
Declaration
public bool CanExtend(object extendee)
Parameters
System.Object
extendee
The target object to be extended with context menu functionality. |
Returns
System.Boolean
true if this extender can extend the specified target component; otherwise, false. |
GetRadContextMenu(Control)
Gets the RadContextMenu that is currently associated with the specified control. This method retrieves the context menu that was previously set using SetRadContextMenu(Control, RadContextMenu).
Declaration
public RadContextMenu GetRadContextMenu(Control control)
Parameters
System.Windows.Forms.Control
control
The control for which to retrieve the associated RadContextMenu. |
Returns
RadContextMenu
The RadContextMenu associated with the control, or null if no menu is associated. |
SetRadContextMenu(Control, RadContextMenu)
Associates a RadContextMenu with the specified control and automatically handles right-click events to display the context menu. When a menu is set, the control's MouseDown event is subscribed to handle context menu display. When set to null, the event subscription is removed.
Declaration
public void SetRadContextMenu(Control control, RadContextMenu value)
Parameters
System.Windows.Forms.Control
control
The control to associate with the RadContextMenu. |
RadContextMenu
value
The RadContextMenu to associate with the control, or null to remove the association. |