New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Kendo UI ContextMenu component

Definition

Namespace:Kendo.Mvc.UI

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class ContextMenu : WidgetBase, IHtmlAttributesContainer, INavigationItemComponent<ContextMenuItem>, INavigationItemContainer<ContextMenuItem>

Inheritance: objectWidgetBaseContextMenu

Implements: IHtmlAttributesContainerINavigationItemComponent<ContextMenuItem>INavigationItemContainer<ContextMenuItem>

Inherited Members WidgetBase.Render()WidgetBase.Serialize()WidgetBase.ToClientTemplate()WidgetBase.ToHtmlString()WidgetBase.VerifySettings()WidgetBase.WriteDeferredStyles(TextWriter)WidgetBase.DeferStyles()WidgetBase.ProcessSettings()WidgetBase.GetHtml(bool)WidgetBase.GetInitializator()WidgetBase.RenderHtml(TextWriter)WidgetBase.GetElement()WidgetBase.WriteLicensingScript(TextWriter)WidgetBase.WriteMvvmHtml(TextWriter)WidgetBase.WriteDeferredScriptInitialization()WidgetBase.GetService<TService>()WidgetBase.EventsWidgetBase.IdWidgetBase.SanitezeIdWidgetBase.WriterWidgetBase.InitializerWidgetBase.IsInClientTemplateWidgetBase.IsSelfInitializedWidgetBase.HasDeferredInitializationWidgetBase.HtmlAttributesWidgetBase.ScriptAttributesWidgetBase.HtmlHelperWidgetBase.ModelMetadataProviderWidgetBase.NameWidgetBase.ExplorerWidgetBase.SelectorWidgetBase.IdPrefixWidgetBase.ViewContextWidgetBase.ValueProviderWidgetBase.GeneratorWidgetBase.UrlGeneratorWidgetBase.HtmlEncoderWidgetBase.HasClientComponentWidgetBase.UseMvvmInitializationobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

ContextMenu method.

C#
public ContextMenu(ViewContext viewContext, INavigationItemAuthorization authorization)
Parameters:viewContextViewContextauthorizationINavigationItemAuthorization

Properties

Specifies that ContextMenu should be shown aligned to the target or the filter element if specified.

C#
public bool? AlignToAnchor { get; set; }

Animation member.

C#
public PopupAnimation Animation { get; }

The DOM element to which the ContextMenu will be appended. The element needs to be relatively positioned.

C#
public string AppendTo { get; set; }

Authorization member.

C#
public INavigationItemAuthorization Authorization { get; }

Implements: INavigationItemComponent<ContextMenuItem>.Authorization

Specifies that sub menus should close after item selection (provided they won't navigate).

C#
public bool? CloseOnClick { get; set; }

Copies and uses the styles from the anchor.

C#
public bool? CopyAnchorStyles { get; set; }

Sets the field of the data item that provides the content of the ContextMenu items.

C#
public string DataContentField { get; set; }

Sets the field of the data item that provides the image url of the ContextMenu items.

C#
public string DataImageUrlField { get; set; }

Gets or sets the DataSource.

C#
public DataSource DataSource { get; }

Gets or sets the DataSourceId.

C#
public string DataSourceId { get; set; }

Sets the field of the data item that provides the sprite css class of the ContextMenu items.

C#
public string DataSpriteCssClassField { get; set; }

Sets the field of the data item that provides the text of the ContextMenu items.

C#
public string DataTextField { get; set; }

Sets the field of the data item that provides the url of the ContextMenu items.

C#
public string DataUrlField { get; set; }

Direction member.

C#
public string Direction { get; set; }

Specifies ContextMenu filter selector - the ContextMenu will only be shown on items that satisfy the provided selector.

C#
public string Filter { get; set; }

HighlightPath member.

C#
public bool? HighlightPath { get; set; }

Specifies the delay in ms before the sub menus are opened/closed - used to avoid accidental closure on leaving.

C#
public double? HoverDelay { get; set; }

ItemAction member.

C#
public Action<ContextMenuItem> ItemAction { get; set; }

Implements: INavigationItemComponent<ContextMenuItem>.ItemAction

Items member.

C#
public IList<ContextMenuItem> Items { get; }

Implements: INavigationItemContainer<ContextMenuItem>.Items

OpenOnClick member.

C#
public bool? OpenOnClick { get; set; }

Specifies the orientation in which the menu items will be ordered

C#
public ContextMenuOrientation? Orientation { get; set; }

If enabled, the ContextMenu displays buttons that scroll the items when they cannot fit the viewport height. By default, scrolling is disabled.

C#
public ContextMenuScrollableSettings Scrollable { get; }

SecurityTrimming member.

C#
public SecurityTrimming SecurityTrimming { get; set; }

Implements: INavigationItemComponent<ContextMenuItem>.SecurityTrimming

Specifies the event or events on which ContextMenu should open. By default ContextMenu will show on contextmenu event on desktop and hold event on touch devices. Could be any pointer/mouse/touch event, also several, separated by spaces.

C#
public string ShowOn { get; set; }

Specifies the element on which ContextMenu should open. The default element is the document body.

C#
public string Target { get; set; }

Methods

SerializeSettings method.

C#
protected override Dictionary<string, object> SerializeSettings()
Returns:

Dictionary<string, object>

Overrides: WidgetBase.SerializeSettings()

Writes the HTML content.

C#
protected override void WriteHtml(TextWriter writer)
Parameters:writerTextWriter

The text writer.

Overrides: WidgetBase.WriteHtml(TextWriter)

WriteInitializationScript method.

C#
public override void WriteInitializationScript(TextWriter writer)
Parameters:writerTextWriter

Overrides: WidgetBase.WriteInitializationScript(TextWriter)