Menu
Kendo UI Menu component
Definition
Namespace:Kendo.Mvc.UI
Assembly:Kendo.Mvc.dll
Syntax:
public class Menu : WidgetBase, IHtmlAttributesContainer, INavigationItemComponent<MenuItem>, INavigationItemContainer<MenuItem>
Inheritance: objectWidgetBaseMenu
Implements:
Inherited Members
Constructors
Initializes a new instance of the Menu class.
public Menu(ViewContext viewContext, INavigationItemAuthorization authorization)
Properties
Animation member.
public PopupAnimation Animation { get; }
Authorization member.
public INavigationItemAuthorization Authorization { get; }
Implements:
Specifies that sub menus should close after item selection (provided they won't navigate).
public bool? CloseOnClick { get; set; }
Sets the field of the data item that provides the trailing actions-region content of the menu items, rendered as a k-menu-link-actions span positioned before the item's expand/collapse arrow. This is useful for displaying supplementary information next to a menu item's label, such as a keyboard-shortcut hint (for example, Ctrl+N). If not set, the Menu falls back to using the actions field of the data item. The actions content is rendered as raw, unencoded HTML, so make sure that any value supplied through dataActionsField (or through the item's actions field) is trusted in the same way as content supplied through dataContentField.
public string DataActionsField { get; set; }
Sets the field of the data item that provides the content of the menu items.
public string DataContentField { get; set; }
Sets the field of the data item that provides the secondary description line of the menu items, rendered as a k-menu-link-description span displayed beneath the item's label. This is useful for showing additional context about a menu item, such as a short explanatory note under its title. If not set, the Menu falls back to using the description field of the data item. The description content is HTML-encoded by default, consistent with the item's text, and this can be disabled per item by setting encoded: false on the data item.
public string DataDescriptionField { get; set; }
Sets the field of the data item that provides the icon class of the menu items.
public string DataIconClassField { get; set; }
Sets the field of the data item that provides the icon name of the menu items.The field can also hold an icon descriptor such as { name: "gear", variant: "outline" }. The variant can be outline, solid, or duotone; it applies to SVG rendering and is ignored for font icons.
public string DataIconField { get; set; }
Sets the field of the data item that provides the image url of the menu items.
public string DataImageUrlField { get; set; }
Gets or sets the DataSource.
public DataSource DataSource { get; }
Gets or sets the DataSourceId.
public string DataSourceId { get; set; }
Sets the field of the data item that provides the sprite css class of the menu items.
public string DataSpriteCssClassField { get; set; }
Sets the field of the data item that provides the text of the menu items.
public string DataTextField { get; set; }
Sets the field of the data item that provides the url of the menu items.
public string DataUrlField { get; set; }
HighlightPath member.
public bool? HighlightPath { get; set; }
Specifies the delay in ms before the menu is opened/closed - used to avoid accidental closure on leaving.
public double? HoverDelay { get; set; }
Specifies the position of the icon in the Menu items using the text content as a reference.
public IconPosition? IconPosition { get; set; }
ItemAction member.
public Action<MenuItem> ItemAction { get; set; }
Implements:
Specifies that the root sub menus will be opened on item click.
public MenuOpenOnClickSettings OpenOnClick { get; }
Specifies the orientation in which the menu items will be ordered.
public MenuOrientation? Orientation { get; set; }
If enabled, the Menu displays buttons that scroll the items when they cannot fit the width or the popups' height of the Menu. By default, scrolling is disabled.The following example demonstrates how to enable the scrolling functionality.
public MenuScrollableSettings Scrollable { get; }
SecurityTrimming member.
public SecurityTrimming SecurityTrimming { get; set; }
Implements:
Sets the size of the component.
public ComponentSize? Size { get; set; }
Methods
Serializes the component settings to a dictionary.
public override IDictionary<string, object> Serialize()
A dictionary of settings.
Overrides:
SerializeSettings method.
protected override Dictionary<string, object> SerializeSettings()
Overrides:
Writes the HTML content.
protected override void WriteHtml(TextWriter writer)
The text writer.
Overrides:
WriteInitializationScript method.
public override void WriteInitializationScript(TextWriter writer)
Overrides: