ClassRadContextMenu
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:
[TelerikToolboxCategory("Menus & Toolbars")]
[RadToolboxItem(false)]
[ToolboxBitmap(typeof(RadContextMenu), "RadDropDownMenu.bmp")]
public class RadContextMenu : Component, IComponent, IDisposable, IAnalyticsProvider
Inheritance: objectMarshalByRefObjectComponentRadContextMenu
Derived Classes:
Implements:
Inherited Members
Constructors
RadContextMenu()
Initializes a new instance of the RadContextMenu class.
Declaration
public RadContextMenu()
RadContextMenu(IContainer)
Initializes a new instance of the RadContextMenu class with the specified container.
Declaration
public RadContextMenu(IContainer owner)
Parameters
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
ownerElement
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
public bool AnimationEnabled { get; set; }
Property Value
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.
AnimationType
Gets or sets a value determining what animation type to use when showing the popup.
Declaration
public PopupAnimationTypes AnimationType { get; set; }
Property Value
DropDown
Gets the underlying dropdown menu panel that manages the display and behavior of the context menu.
Declaration
[Browsable(false)]
public RadDropDownMenu DropDown { get; }
Property Value
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
[Browsable(true)]
public bool EnableAnalytics { get; set; }
Property Value
Implements
ImageList
Gets or sets the image list that contains the images displayed by menu items in this context menu.
Items
Gets the collection of menu items contained in this context menu.
Declaration
[Browsable(true)]
public RadItemOwnerCollection Items { get; }
Property Value
A RadItemOwnerCollection containing the menu items.
ThemeName
Gets or sets the theme name for customizing the visual appearance of the context menu.
Declaration
[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
Dispose(bool)
Declaration
protected override void Dispose(bool disposing)
Parameters
disposing
Overrides
OnDropDownClosed()
Raises the DropDownClosed event.
Declaration
protected virtual void OnDropDownClosed()
OnDropDownClosing(CancelEventArgs)
Raises the DropDownClosing event.
Declaration
protected virtual void OnDropDownClosing(CancelEventArgs args)
Parameters
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
args
The event arguments
Show()
Displays the context menu in its default position.
Declaration
public void Show()
Show(Control, Point)
Positions the context menu relative to the specified control location.
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
control
The control that is the reference point for the RadDropDownMenu position.
point
The horizontal and vertical location of the reference control's upper-left corner, in pixels.
popupDirection
One of the RadDirection values.
Show(Control, int, int)
Positions the context menu relative to the specified control location.
Declaration
public void Show(Control control, int x, int y)
Parameters
control
The control that is the reference point for the RadDropDownMenu position.
x
The horizontal coordinate relative to the control, in pixels.
y
The vertical coordinate relative to the control, in pixels.
Show(Point)
Displays the context menu relative to the specified screen location.
Declaration
public void Show(Point point)
Parameters
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
point
The horizontal and vertical location of the screen's upper-left corner, in pixels.
popupDirection
One of the RadDirection values.
Show(RadItem, Point)
Positions the context menu relative to the specified RadItem location.
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
item
The RadItem that is the reference point for the RadDropDownMenu position.
point
The horizontal and vertical location of the RadItem's upper-left corner, in pixels.
popupDirection
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
public void Show(RadItem item, int ownerOffset, RadDirection popupDirection)
Parameters
item
The RadItem that is the reference point for the RadDropDownMenu position.
ownerOffset
Specifies the offset from the owner in pixels.
popupDirection
One of the RadDirection values.
Show(RadItem, int, int)
Positions the context menu relative to the specified RadItem location.
Declaration
public void Show(RadItem item, int x, int y)
Parameters
item
The RadItem that is the reference point for the RadDropDownMenu position.
x
The horizontal coordinate relative to the control, in pixels.
y
The vertical coordinate relative to the control, in pixels.
Show(int, int)
Displays the context menu relative to the specified screen location.
Events
DropDownClosed
Occurs when the context menu dropdown has closed.
DropDownClosing
Occurs when the context menu dropdown is about to close.
Declaration
public event CancelEventHandler DropDownClosing
Event Value
DropDownOpened
Occurs when the context menu dropdown has opened.
DropDownOpening
Occurs when the context menu dropdown is about to open.
Declaration
public event CancelEventHandler DropDownOpening
Event Value