ClassRadContextMenuManager
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.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
[TelerikToolboxCategory("Menus & Toolbars")]
[ToolboxBitmap(typeof(RadContextMenu), "RadContextMenuManager.bmp")]
public class RadContextMenuManager : Component, IComponent, IDisposable, IExtenderProvider
Inheritance: objectMarshalByRefObjectComponentRadContextMenuManager
Implements:
Inherited Members
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.
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
control
The control for which to retrieve the associated RadContextMenu.
Returns
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
control
The control to associate with the RadContextMenu.
value
The RadContextMenu to associate with the control, or null to remove the association.