Context Menu - Overview

The Context Menu component allows you to add a context menu to your Blazor application. To invoke the context menu at runtime, users can right-click the area where they want to display the context menu. To display the context menu in code, call the Show method.

This demo illustrates how to add the Context Menu component to an application.

Context Menu - Binding to Hierarchical Data

The Context Menu can be bound to hierarchical data structures. Specify the following properties to bind the component to a hierarchical data structure:

  • Data - A Context Menu data source object.
  • ChildrenExpression - A lambda expression that returns the data item’s children.

The following properties specify expressions that return menu item information (text, name, and etc.):

  • NameExpression - A lambda expression that returns a menu item’s unique identifier (name).
  • ClickExpression - A lambda expression that returns a handler for a menu item’s Click event.
  • TextExpression - A lambda expression that returns a menu item’s text.
  • IconUrlExpression - A lambda expression that returns the URL of a menu item icon.
  • BeginGroupExpression - A lambda expression that specifies the start of an item group.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sit amet metus vel nisi blandit tincidunt vel efficitur purus. Nunc nec turpis tempus, accumsan orci auctor, imperdiet mauris. Fusce id purus magna.