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.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

cs-api-definition
[TelerikToolboxCategory("Menus & Toolbars")]
[ToolboxBitmap(typeof(RadContextMenu), "RadContextMenuManager.bmp")]
public class RadContextMenuManager : Component, IComponent, IDisposable, IExtenderProvider

Inheritance: objectMarshalByRefObjectComponentRadContextMenuManager

Implements: IComponentIDisposableIExtenderProvider

Inherited Members Component.Dispose()Component.Dispose(bool)Component.GetService(Type)Component.ToString()Component.CanRaiseEventsComponent.EventsComponent.SiteComponent.ContainerComponent.DesignModeComponent.DisposedMarshalByRefObject.MemberwiseClone(bool)MarshalByRefObject.GetLifetimeService()MarshalByRefObject.InitializeLifetimeService()MarshalByRefObject.CreateObjRef(Type)

Constructors

RadContextMenuManager()

Declaration

cs-api-definition
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

cs-api-definition
public bool CanExtend(object extendee)

Parameters

extendee

object

The target object to be extended with context menu functionality.

Returns

bool

true if this extender can extend the specified target component; otherwise, false.

Implements IExtenderProvider.CanExtend(object)

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

cs-api-definition
public RadContextMenu GetRadContextMenu(Control control)

Parameters

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

cs-api-definition
public void SetRadContextMenu(Control control, RadContextMenu value)

Parameters

control

Control

The control to associate with the RadContextMenu.

value

RadContextMenu

The RadContextMenu to associate with the control, or null to remove the association.