New to Telerik UI for WinFormsStart a free 30-day trial

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

Definition

Constructors

Initializes a new instance of the RadContextMenu class.

C#
public RadContextMenu()

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

C#
public RadContextMenu(IContainer owner)
Parameters:ownerIContainer

The container that owns this context menu.

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

C#
public RadContextMenu(RadElement ownerElement)
Parameters:ownerElementRadElement

The RadElement that owns this context menu.

Properties

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

C#
public bool AnimationEnabled { get; set; }
Property Value:

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

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

C#
public int AnimationFrames { get; set; }

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

C#
public PopupAnimationTypes AnimationType { get; set; }

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

C#
[Browsable(false)]
public RadDropDownMenu DropDown { get; }
Property Value:

A RadDropDownMenu representing the dropdown panel.

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

C#
[Browsable(true)]
public bool EnableAnalytics { get; set; }

Implements: IAnalyticsProvider.EnableAnalytics

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

C#
[Browsable(true)]
public ImageList ImageList { get; set; }
Property Value:

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

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

C#
[Browsable(true)]
public RadItemOwnerCollection Items { get; }
Property Value:

A RadItemOwnerCollection containing the menu items.

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

C#
[Browsable(true)]
public string ThemeName { get; set; }
Property Value:

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

C#
protected override void Dispose(bool disposing)
Parameters:disposingbool

Overrides: Component.Dispose(bool)

Raises the DropDownClosed event.

C#
protected virtual void OnDropDownClosed()

Raises the DropDownClosing event.

C#
protected virtual void OnDropDownClosing(CancelEventArgs args)
Parameters:argsCancelEventArgs

The event arguments

Raises the DropDownOpened event.

C#
protected virtual void OnDropDownOpened()

Raises the DropDownOpening event.

C#
protected virtual void OnDropDownOpening(CancelEventArgs args)
Parameters:argsCancelEventArgs

The event arguments

Displays the context menu in its default position.

C#
public void Show()

Positions the context menu relative to the specified control location.

C#
public void Show(Control control, int x, int y)
Parameters:controlControl

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

xint

The horizontal coordinate relative to the control, in pixels.

yint

The vertical coordinate relative to the control, in pixels.

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

C#
public void Show(Control control, Point point, RadDirection popupDirection)
Parameters:controlControl

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

pointPoint

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

popupDirectionRadDirection

One of the RadDirection values.

Positions the context menu relative to the specified control location.

C#
public void Show(Control control, Point point)
Parameters:controlControl

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

pointPoint

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

Displays the context menu relative to the specified screen location.

C#
public void Show(int x, int y)
Parameters:xint

The horizontal screen coordinate, in pixels.

yint

The vertical screen coordinate, in pixels.

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

C#
public void Show(Point point, RadDirection popupDirection)
Parameters:pointPoint

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

popupDirectionRadDirection

One of the RadDirection values.

Displays the context menu relative to the specified screen location.

C#
public void Show(Point point)
Parameters:pointPoint

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

Positions the context menu relative to the specified RadItem location.

C#
public void Show(RadItem item, int x, int y)
Parameters:itemRadItem

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

xint

The horizontal coordinate relative to the control, in pixels.

yint

The vertical coordinate relative to the control, in pixels.

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

C#
public void Show(RadItem item, int ownerOffset, RadDirection popupDirection)
Parameters:itemRadItem

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

ownerOffsetint

Specifies the offset from the owner in pixels.

popupDirectionRadDirection

One of the RadDirection values.

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

C#
public void Show(RadItem item, Point point, RadDirection popupDirection)
Parameters:itemRadItem

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

pointPoint

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

popupDirectionRadDirection

One of the RadDirection values.

Positions the context menu relative to the specified RadItem location.

C#
public void Show(RadItem item, Point point)
Parameters:itemRadItem

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

pointPoint

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

Events

Occurs when the context menu dropdown has closed.

C#
public event EventHandler DropDownClosed

Occurs when the context menu dropdown is about to close.

C#
public event CancelEventHandler DropDownClosing

Occurs when the context menu dropdown has opened.

C#
public event EventHandler DropDownOpened

Occurs when the context menu dropdown is about to open.

C#
public event CancelEventHandler DropDownOpening