Class RadContextMenu
Represents a context menu that can be associated with controls or elements to provide contextual menu functionality.
Inheritance
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
[TelerikToolboxCategory("Menus & Toolbars")]
[RadToolboxItem(false)]
public class RadContextMenu : Component, IAnalyticsProvider
Constructors
RadContextMenu()
RadContextMenu(IContainer)
Initializes a new instance of the RadContextMenu class with the specified container.
Declaration
public RadContextMenu(IContainer owner)
Parameters
System.ComponentModel.IContainer
owner
The container that owns this context menu. |
RadContextMenu(RadElement)
Initializes a new instance of the RadContextMenu class with the specified owner element.
Declaration
public RadContextMenu(RadElement ownerElement)
Parameters
RadElement
ownerElement
The RadElement that owns this context menu. |
Properties
AnalyticsName
Gets or sets the Analytics Name associated with this control.
Declaration
public string AnalyticsName { get; set; }
Property Value
System.String
|
Implements
AnimationEnabled
Gets or sets a value indicating whether popup animation is enabled when the context menu opens and closes.
Declaration
public bool AnimationEnabled { get; set; }
Property Value
System.Boolean
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
public int AnimationFrames { get; set; }
Property Value
System.Int32
|
AnimationType
Gets or sets a value determining what animation type to use when showing the popup.
Declaration
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
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
public bool EnableAnalytics { get; set; }
Property Value
System.Boolean
|
Implements
ImageList
Gets or sets the image list that contains the images displayed by menu items in this context menu.
Declaration
public ImageList ImageList { get; set; }
Property Value
System.Windows.Forms.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
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
public string ThemeName { get; set; }
Property Value
System.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(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
System.Boolean
disposing
|
OnDropDownClosed()
Raises the DropDownClosed event.
Declaration
protected virtual void OnDropDownClosed()
OnDropDownClosing(CancelEventArgs)
Raises the DropDownClosing event.
Declaration
protected virtual void OnDropDownClosing(CancelEventArgs args)
Parameters
System.ComponentModel.CancelEventArgs
args
The event arguments |
OnDropDownOpened()
Raises the DropDownOpened event.
Declaration
protected virtual void OnDropDownOpened()
OnDropDownOpening(CancelEventArgs)
Raises the DropDownOpening event.
Declaration
protected virtual void OnDropDownOpening(CancelEventArgs args)
Parameters
System.ComponentModel.CancelEventArgs
args
The event arguments |
Show()
Displays the context menu in its default position.
Declaration
public void Show()
Show(Point)
Displays the context menu relative to the specified screen location.
Declaration
public void Show(Point point)
Parameters
System.Drawing.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
public void Show(Point point, RadDirection popupDirection)
Parameters
System.Drawing.Point
point
The horizontal and vertical location of the screen's upper-left corner, in pixels. |
RadDirection
popupDirection
One of the RadDirection values. |
Show(Int32, Int32)
Displays the context menu relative to the specified screen location.
Declaration
public void Show(int x, int y)
Parameters
System.Int32
x
The horizontal screen coordinate, in pixels. |
System.Int32
y
The vertical screen coordinate, in pixels. |
Show(Control, Point)
Positions the context menu relative to the specified control location.
Declaration
public void Show(Control control, Point point)
Parameters
System.Windows.Forms.Control
control
The control that is the reference point for the RadDropDownMenu position. |
System.Drawing.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
public void Show(Control control, Point point, RadDirection popupDirection)
Parameters
System.Windows.Forms.Control
control
The control that is the reference point for the RadDropDownMenu position. |
System.Drawing.Point
point
The horizontal and vertical location of the reference control's upper-left corner, in pixels. |
RadDirection
popupDirection
One of the RadDirection values. |
Show(Control, Int32, Int32)
Positions the context menu relative to the specified control location.
Declaration
public void Show(Control control, int x, int y)
Parameters
System.Windows.Forms.Control
control
The control that is the reference point for the RadDropDownMenu position. |
System.Int32
x
The horizontal coordinate relative to the control, in pixels. |
System.Int32
y
The vertical coordinate relative to the control, in pixels. |
Show(RadItem, Point)
Positions the context menu relative to the specified RadItem location.
Declaration
public void Show(RadItem item, Point point)
Parameters
RadItem
item
The RadItem that is the reference point for the RadDropDownMenu position. |
System.Drawing.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
public void Show(RadItem item, Point point, RadDirection popupDirection)
Parameters
RadItem
item
The RadItem that is the reference point for the RadDropDownMenu position. |
System.Drawing.Point
point
The horizontal and vertical location of the RadItem's upper-left corner, in pixels. |
RadDirection
popupDirection
One of the RadDirection values. |
Show(RadItem, Int32, Int32)
Positions the context menu relative to the specified RadItem location.
Declaration
public void Show(RadItem item, int x, int y)
Parameters
RadItem
item
The RadItem that is the reference point for the RadDropDownMenu position. |
System.Int32
x
The horizontal coordinate relative to the control, in pixels. |
System.Int32
y
The vertical coordinate relative to the control, in pixels. |
Show(RadItem, Int32, RadDirection)
Positions the context menu relative to the specified RadItem location and with specified direction and offset according to the owner.
Declaration
public void Show(RadItem item, int ownerOffset, RadDirection popupDirection)
Parameters
RadItem
item
The RadItem that is the reference point for the RadDropDownMenu position. |
System.Int32
ownerOffset
Specifies the offset from the owner in pixels. |
RadDirection
popupDirection
One of the RadDirection values. |
Events
DropDownClosed
Occurs when the context menu dropdown has closed.
Declaration
public event EventHandler DropDownClosed
Event Type
System.EventHandler
|
DropDownClosing
Occurs when the context menu dropdown is about to close.
Declaration
public event CancelEventHandler DropDownClosing
Event Type
System.ComponentModel.CancelEventHandler
|
DropDownOpened
Occurs when the context menu dropdown has opened.
Declaration
public event EventHandler DropDownOpened
Event Type
System.EventHandler
|
DropDownOpening
Occurs when the context menu dropdown is about to open.
Declaration
public event CancelEventHandler DropDownOpening
Event Type
System.ComponentModel.CancelEventHandler
|