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:
[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
Initializes a new instance of the RadContextMenu class.
public RadContextMenu()
Initializes a new instance of the RadContextMenu class with the specified container.
public RadContextMenu(IContainer owner)
The container that owns this context menu.
Initializes a new instance of the RadContextMenu class with the specified owner element.
public RadContextMenu(RadElement ownerElement)
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.
public bool AnimationEnabled { get; set; }
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.
public int AnimationFrames { get; set; }
Gets or sets a value determining what animation type to use when showing the popup.
public PopupAnimationTypes AnimationType { get; set; }
Gets the underlying dropdown menu panel that manages the display and behavior of the context menu.
[Browsable(false)]
public RadDropDownMenu DropDown { get; }
A RadDropDownMenu representing the dropdown panel.
Gets or sets a value indicating whether the Analytics functionality is enabled or disabled for this control.
[Browsable(true)]
public bool EnableAnalytics { get; set; }
Implements:
Gets or sets the image list that contains the images displayed by menu items in this context menu.
[Browsable(true)]
public ImageList ImageList { get; set; }
An ImageList containing the images for menu items. The default value is null.
Gets the collection of menu items contained in this context menu.
[Browsable(true)]
public RadItemOwnerCollection Items { get; }
A RadItemOwnerCollection containing the menu items.
Gets or sets the theme name for customizing the visual appearance of the context menu.
[Browsable(true)]
public string ThemeName { get; set; }
A string representing the theme name. The default value is an empty string.
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
Raises the DropDownClosed event.
protected virtual void OnDropDownClosed()
Raises the DropDownClosing event.
protected virtual void OnDropDownClosing(CancelEventArgs args)
The event arguments
Raises the DropDownOpened event.
protected virtual void OnDropDownOpened()
Raises the DropDownOpening event.
protected virtual void OnDropDownOpening(CancelEventArgs args)
The event arguments
Displays the context menu in its default position.
public void Show()
Positions the context menu relative to the specified control location.
Positions the context menu relative to the specified control location and with the specified direction.
public void Show(Control control, Point point, RadDirection popupDirection)
The control that is the reference point for the RadDropDownMenu position.
pointPointThe horizontal and vertical location of the reference control's upper-left corner, in pixels.
popupDirectionRadDirectionOne of the RadDirection values.
Positions the context menu relative to the specified control location.
Positions the context menu relative to the specified screen location and with the specified direction.
public void Show(Point point, RadDirection popupDirection)
The horizontal and vertical location of the screen's upper-left corner, in pixels.
popupDirectionRadDirectionOne of the RadDirection values.
Displays the context menu relative to the specified screen location.
public void Show(Point point)
The horizontal and vertical location of the screen's upper-left corner, in pixels.
Positions the context menu relative to the specified RadItem location.
Positions the context menu relative to the specified RadItem location and with specified direction and offset according to the owner.
public void Show(RadItem item, int ownerOffset, RadDirection popupDirection)
The RadItem that is the reference point for the RadDropDownMenu position.
ownerOffsetintSpecifies the offset from the owner in pixels.
popupDirectionRadDirectionOne of the RadDirection values.
Positions the context menu relative to the specified RadItem location and with the specified direction.
public void Show(RadItem item, Point point, RadDirection popupDirection)
The RadItem that is the reference point for the RadDropDownMenu position.
pointPointThe horizontal and vertical location of the RadItem's upper-left corner, in pixels.
popupDirectionRadDirectionOne of the RadDirection values.
Positions the context menu relative to the specified RadItem location.
Events
Occurs when the context menu dropdown has closed.
public event EventHandler DropDownClosed
Occurs when the context menu dropdown is about to close.
public event CancelEventHandler DropDownClosing
Occurs when the context menu dropdown has opened.
public event EventHandler DropDownOpened
Occurs when the context menu dropdown is about to open.
public event CancelEventHandler DropDownOpening