RadContextMenu
This partial Class describes the client properties and events in RadContextMenu.
The RadContextMenu control is used to display context-aware options for various targets. Those targets are specified through the Targets property. RadContextMenu supports the following targets:
- ContextMenuControlTarget - Used to associate a context menu with an ASP.NET Server control. Accepts the control ID as an argument.
- ContextMenuElementTarget - Used to associate a context menu with an HTML element. Accepts the HTML element id as an argument.
- ContextMenuDocumentTarget - Used to specify document-wide context menu.
- ContextMenuTagNameTarget - Used to associate a context menu with all elements with the specified tag name (e.g. IMG, INPUT).
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
[RequiredCss("Telerik.Web.UI.Skins.Common.fonticons.css", RenderMode.Lightweight, typeof(RadContextMenu))]
[RequiredCss("Telerik.Web.UI.Skins.Common.fonticons.css", RenderMode.Mobile, typeof(RadContextMenu))]
[RequiredCss("Telerik.Web.UI.Skins.Common.MaterialRipple.css", RenderMode.Lightweight, typeof(RadButton))]
[RequiredCss("Telerik.Web.UI.Skins.Common.MaterialRipple.css", RenderMode.Mobile, typeof(RadButton))]
[ClientScriptResource("Telerik.Web.UI.RadContextMenu", "Telerik.Web.UI.Menu.ContextMenu.RadContextMenuScripts.js", LoadOrder = 7)]
[TelerikToolboxCategory("Navigation")]
public class RadContextMenu : RadMenu, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IControlResolver, IPostBackDataHandler, ISkinnableControl, IControl, IFeatureGroup, INamingContainer, IXmlSerializable, IControlItemContainer, IRadMenuItemContainer, IPostBackEventHandler
Inheritance: objectControlWebControlBaseDataBoundControlDataBoundControlRadDataBoundControlControlItemContainerHierarchicalControlItemContainerRadMenuRadContextMenu...
Derived Classes:
Implements:
Inherited Members
Constructors
public RadContextMenu()
Properties
Gets or sets a value indicating if the currently selected item will be tracked and highlighted.
[ClientControlProperty]
[ClientPropertyName("enableSelection")]
public override bool EnableSelection { get; set; }
Overrides:
Gets or sets a value indicating the client-side event handler that is called when the RadContextMenu is hidden.
[ClientControlEvent]
[ClientPropertyName("hidden")]
public string OnClientHidden { get; set; }
A string specifying the name of the JavaScript function that will handle the event. The default value is empty string.
If specified, the OnClientHidden client-side event handler is called after the context menu is hidden on the client. Two parameters are passed to the handler:
- sender, the menu client object;
- eventArgs with one property, get_domEvent (a reference to the browser event).
Gets or sets a value indicating the client-side event handler that is called when the RadContextMenu is to be hidden.
[ClientControlEvent]
[ClientPropertyName("hiding")]
public virtual string OnClientHiding { get; set; }
A string specifying the name of the JavaScript function that will handle the event. The default value is empty string.
If specified, the OnClientHiding client-side event handler is called before the context menu is hidden on the client. Two parameters are passed to the handler:
- sender, the menu client object;
- eventArgs with two properties, get_cancel()/set_cancel(cancel) and get_domEvent (a reference to the browser event).
The OnClientHiding event can be cancelled. To do so, set the cancel property to false from the event handler (e.g. eventArgs.set_cancel(true);).
Gets or sets a value indicating the client-side event handler that is called when the RadContextMenu is to be displayed.
[ClientControlEvent]
[ClientPropertyName("showing")]
public virtual string OnClientShowing { get; set; }
A string specifying the name of the JavaScript function that will handle the event. The default value is empty string.
If specified, the OnClientShowing client-side event handler is called before the context menu is shown on the client. Two parameters are passed to the handler:
- sender, the menu client object;
- eventArgs with two properties, get_cancel()/set_cancel(cancel) and get_domEvent (a reference to the browser event).
The OnClientShowing event can be cancelled. To do so, set the cancel property to false from the event handler (e.g. eventArgs.set_cancel(true);).
Gets or sets a value indicating the client-side event handler that is called when the RadContextMenu is displayed.
[ClientControlEvent]
[ClientPropertyName("shown")]
public virtual string OnClientShown { get; set; }
A string specifying the name of the JavaScript function that will handle the event. The default value is empty string.
If specified, the OnClientShown client-side event handler is called after the context menu is shown on the client. Two parameters are passed to the handler:
- sender, the menu client object;
- eventArgs with one property, get_domEvent (a reference to the browser event).
protected override bool SupportsAdaptiveRendering { get; }
Overrides:
Gets the collection containing the targets to which right-click RadContextMenu will attach.
[PersistenceMode(PersistenceMode.InnerProperty)]
public virtual ContextMenuTargetCollection Targets { get; }
A ContextMenuTargetCollection containing the targets to which RadContextMenu will attach.
RadContextMenu can attach to four target types: ASP.NET control, element on the page, document, set of client-side elements, specified by tagName.
Methods
protected override void AddAttributesToRender(HtmlTextWriter writer)
Overrides:
protected override void DescribeClientEvents(IScriptDescriptor descriptor)
Overrides:
protected override void DescribeClientProperties(IScriptDescriptor descriptor)
Overrides:
protected override void RenderContents(HtmlTextWriter writer)
Overrides:
protected override void TrackViewState()
Overrides: