Demos About Radzen
Search Results for

    Show / Hide Table of Contents

    Class RadzenContextMenu

    RadzenContextMenu component.

    Inheritance
    System.Object
    RadzenContextMenu
    Namespace: Radzen.Blazor
    Assembly: Radzen.Blazor.dll
    Syntax
    public class RadzenContextMenu : object
    Examples
    @inject ContextMenuService ContextMenuService
    
    <RadzenButton Text="Show context menu" ContextMenu=@(args => ShowContextMenuWithItems(args)) />
    
    @code {
      void ShowContextMenuWithItems(MouseEventArgs args)
      {
        ContextMenuService.Open(args,
            new List<ContextMenuItem> {
                new ContextMenuItem() { Text = "Context menu item 1", Value = 1 },
                new ContextMenuItem() { Text = "Context menu item 2", Value = 2 },
                new ContextMenuItem() { Text = "Context menu item 3", Value = 3 },
         }, OnMenuItemClick);
      }
    
      void OnMenuItemClick(MenuItemEventArgs args)
      {
        Console.WriteLine($"Menu item with Value={args.Value} clicked");
      }
    }

    Properties

    UniqueID

    Gets or sets the unique identifier.

    Declaration
    public string UniqueID { get; set; }
    Property Value
    Type Description
    System.String

    The unique identifier.

    Methods

    Close()

    Closes this instance.

    Declaration
    public async Task Close()
    Returns
    Type Description
    Task

    Dispose()

    Declaration
    public void Dispose()

    OnAfterRenderAsync(Boolean)

    Declaration
    protected override async Task OnAfterRenderAsync(bool firstRender)
    Parameters
    Type Name Description
    System.Boolean firstRender
    Returns
    Type Description
    Task

    OnInitialized()

    Declaration
    protected override void OnInitialized()

    Open(MouseEventArgs, ContextMenuOptions)

    Opens the menu.

    Declaration
    public async Task Open(MouseEventArgs args, ContextMenuOptions options)
    Parameters
    Type Name Description
    MouseEventArgs args

    The instance containing the event data.

    ContextMenuOptions options

    The options.

    Returns
    Type Description
    Task

    Boost your Blazor development with Radzen

    Radzen is a desktop tool that gives you the power to create line of business applications. Build and launch Blazor apps visually, while we generate clean code for you.

    Learn More

    Download Radzen
    Download Radzen
    In This Article
    Back to top Radzen Blazor Components, © 2018-2022 Radzen. Source Code licensed under MIT