Class
RadContextMenu

Represents a context menu that can be associated with controls or elements to provide contextual menu functionality.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

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

Inheritance: objectMarshalByRefObjectComponentRadContextMenu

Derived Classes: GanttViewDefaultContextMenuPdfViewerContextMenuPivotGridContextMenuBasePropertyGridDefaultContextMenuSchedulerDefaultContextMenuTextBoxControlDefaultContextMenuTreeViewDefaultContextMenu

Implements: IAnalyticsProviderIComponentIDisposable

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

Constructors

RadContextMenu()

Initializes a new instance of the RadContextMenu class.

Declaration

cs-api-definition
public RadContextMenu()

RadContextMenu(IContainer)

Initializes a new instance of the RadContextMenu class with the specified container.

Declaration

cs-api-definition
public RadContextMenu(IContainer owner)

Parameters

owner

IContainer

The container that owns this context menu.

RadContextMenu(RadElement)

Initializes a new instance of the RadContextMenu class with the specified owner element.

Declaration

cs-api-definition
public RadContextMenu(RadElement ownerElement)

Parameters

ownerElement

RadElement

The RadElement that owns this context menu.

Properties

AnimationEnabled

Gets or sets a value indicating whether popup animation is enabled when the context menu opens and closes.

Declaration

cs-api-definition
public bool AnimationEnabled { get; set; }

Property Value

bool

true if animation is enabled; otherwise, false. The default value is true.

AnimationFrames

Gets or sets the count of the frames of the drop down animation.

Declaration

cs-api-definition
public int AnimationFrames { get; set; }

Property Value

int

AnimationType

Gets or sets a value determining what animation type to use when showing the popup.

Declaration

cs-api-definition
public PopupAnimationTypes AnimationType { get; set; }

Property Value

PopupAnimationTypes

DropDown

Gets the underlying dropdown menu panel that manages the display and behavior of the context menu.

Declaration

cs-api-definition
[Browsable(false)]
public RadDropDownMenu DropDown { get; }

Property Value

RadDropDownMenu

A RadDropDownMenu representing the dropdown panel.

EnableAnalytics

Gets or sets a value indicating whether the Analytics functionality is enabled or disabled for this control.

Declaration

cs-api-definition
[Browsable(true)]
public bool EnableAnalytics { get; set; }

Property Value

bool

Implements IAnalyticsProvider.EnableAnalytics

ImageList

Gets or sets the image list that contains the images displayed by menu items in this context menu.

Declaration

cs-api-definition
[Browsable(true)]
public ImageList ImageList { get; set; }

Property Value

ImageList

An ImageList containing the images for menu items. The default value is null.

Items

Gets the collection of menu items contained in this context menu.

Declaration

cs-api-definition
[Browsable(true)]
public RadItemOwnerCollection Items { get; }

Property Value

RadItemOwnerCollection

A RadItemOwnerCollection containing the menu items.

ThemeName

Gets or sets the theme name for customizing the visual appearance of the context menu.

Declaration

cs-api-definition
[Browsable(true)]
public string ThemeName { get; set; }

Property Value

string

A string representing the theme name. The default value is an empty string.

Remarks

If ThemeResolutionService.ApplicatonThemeName refers to a non-empty string, the theme of a RadControl can differ from the one set using RadControls.ThemeName property. If the themes differ, the RadControls.ThemeName property will be overridden by ThemeResolutionService.ApplicatonThemeName. If no theme is registered with a name as ThemeResolutionService.ApplicatonThemeName, then control will revert to the theme specified by its ThemeName property. If ThemeName is assigned to a non-existing theme name, the control may have no visual properties assigned, which will cause it look and behave in unexpected manner. If ThemeName equals empty string, control's theme is set to a theme that is registered within ThemeResolutionService with the name "ControlDefault".

Methods

Dispose(bool)

Declaration

cs-api-definition
protected override void Dispose(bool disposing)

Parameters

disposing

bool

Overrides Component.Dispose(bool)

OnDropDownClosed()

Raises the DropDownClosed event.

Declaration

cs-api-definition
protected virtual void OnDropDownClosed()

OnDropDownClosing(CancelEventArgs)

Raises the DropDownClosing event.

Declaration

cs-api-definition
protected virtual void OnDropDownClosing(CancelEventArgs args)

Parameters

args

CancelEventArgs

The event arguments

OnDropDownOpened()

Raises the DropDownOpened event.

Declaration

cs-api-definition
protected virtual void OnDropDownOpened()

OnDropDownOpening(CancelEventArgs)

Raises the DropDownOpening event.

Declaration

cs-api-definition
protected virtual void OnDropDownOpening(CancelEventArgs args)

Parameters

args

CancelEventArgs

The event arguments

Show()

Displays the context menu in its default position.

Declaration

cs-api-definition
public void Show()

Show(Control, Point)

Positions the context menu relative to the specified control location.

Declaration

cs-api-definition
public void Show(Control control, Point point)

Parameters

control

Control

The control that is the reference point for the RadDropDownMenu position.

point

Point

The horizontal and vertical location of the reference control's upper-left corner, in pixels.

Show(Control, Point, RadDirection)

Positions the context menu relative to the specified control location and with the specified direction.

Declaration

cs-api-definition
public void Show(Control control, Point point, RadDirection popupDirection)

Parameters

control

Control

The control that is the reference point for the RadDropDownMenu position.

point

Point

The horizontal and vertical location of the reference control's upper-left corner, in pixels.

popupDirection

RadDirection

One of the RadDirection values.

Show(Control, int, int)

Positions the context menu relative to the specified control location.

Declaration

cs-api-definition
public void Show(Control control, int x, int y)

Parameters

control

Control

The control that is the reference point for the RadDropDownMenu position.

x

int

The horizontal coordinate relative to the control, in pixels.

y

int

The vertical coordinate relative to the control, in pixels.

Show(Point)

Displays the context menu relative to the specified screen location.

Declaration

cs-api-definition
public void Show(Point point)

Parameters

point

Point

The horizontal and vertical location of the screen's upper-left corner, in pixels.

Show(Point, RadDirection)

Positions the context menu relative to the specified screen location and with the specified direction.

Declaration

cs-api-definition
public void Show(Point point, RadDirection popupDirection)

Parameters

point

Point

The horizontal and vertical location of the screen's upper-left corner, in pixels.

popupDirection

RadDirection

One of the RadDirection values.

Show(RadItem, Point)

Positions the context menu relative to the specified RadItem location.

Declaration

cs-api-definition
public void Show(RadItem item, Point point)

Parameters

item

RadItem

The RadItem that is the reference point for the RadDropDownMenu position.

point

Point

The horizontal and vertical location of the RadItem's upper-left corner, in pixels.

Show(RadItem, Point, RadDirection)

Positions the context menu relative to the specified RadItem location and with the specified direction.

Declaration

cs-api-definition
public void Show(RadItem item, Point point, RadDirection popupDirection)

Parameters

item

RadItem

The RadItem that is the reference point for the RadDropDownMenu position.

point

Point

The horizontal and vertical location of the RadItem's upper-left corner, in pixels.

popupDirection

RadDirection

One of the RadDirection values.

Show(RadItem, int, RadDirection)

Positions the context menu relative to the specified RadItem location and with specified direction and offset according to the owner.

Declaration

cs-api-definition
public void Show(RadItem item, int ownerOffset, RadDirection popupDirection)

Parameters

item

RadItem

The RadItem that is the reference point for the RadDropDownMenu position.

ownerOffset

int

Specifies the offset from the owner in pixels.

popupDirection

RadDirection

One of the RadDirection values.

Show(RadItem, int, int)

Positions the context menu relative to the specified RadItem location.

Declaration

cs-api-definition
public void Show(RadItem item, int x, int y)

Parameters

item

RadItem

The RadItem that is the reference point for the RadDropDownMenu position.

x

int

The horizontal coordinate relative to the control, in pixels.

y

int

The vertical coordinate relative to the control, in pixels.

Show(int, int)

Displays the context menu relative to the specified screen location.

Declaration

cs-api-definition
public void Show(int x, int y)

Parameters

x

int

The horizontal screen coordinate, in pixels.

y

int

The vertical screen coordinate, in pixels.

Events

DropDownClosed

Occurs when the context menu dropdown has closed.

Declaration

cs-api-definition
public event EventHandler DropDownClosed

Event Value

EventHandler

DropDownClosing

Occurs when the context menu dropdown is about to close.

Declaration

cs-api-definition
public event CancelEventHandler DropDownClosing

Event Value

CancelEventHandler

DropDownOpened

Occurs when the context menu dropdown has opened.

Declaration

cs-api-definition
public event EventHandler DropDownOpened

Event Value

EventHandler

DropDownOpening

Occurs when the context menu dropdown is about to open.

Declaration

cs-api-definition
public event CancelEventHandler DropDownOpening

Event Value

CancelEventHandler