menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DropDownMenuItem - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class DropDownMenuItem

    Inheritance
    System.Object
    DropDownMenuItem
    Namespace: Syncfusion.Blazor.SplitButtons
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class DropDownMenuItem : OwningComponentBase

    Constructors

    DropDownMenuItem()

    Declaration
    public DropDownMenuItem()

    Properties

    ChildContent

    Gets or sets the custom content for the menu item.

    Declaration
    public RenderFragment ChildContent { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.RenderFragment

    A Microsoft.AspNetCore.Components.RenderFragment that defines the content of the item. The default value is null.

    Remarks

    This property allows you to specify custom HTML or component content for a dropdown menu item.

    Disabled

    Gets or sets a value indicating whether the menu item is disabled.

    Declaration
    public bool Disabled { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if the item is disabled; otherwise, false. The default value is false.

    Remarks

    A disabled item cannot be selected or clicked by the user.

    HtmlAttributes

    Gets or sets a collection of additional HTML attributes to be applied to the menu item.

    Declaration
    public Dictionary<string, object> HtmlAttributes { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.Object>

    A System.Collections.Generic.Dictionary<, > where the key is a string representing the attribute name and the value is the attribute's value. The default is null.

    Remarks

    This property allows you to add custom attributes like style, title, etc., to the rendered HTML element of the menu item.

    IconCss

    Gets or sets the CSS class/classes for the icon to be displayed in the menu item.

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

    A string representing the CSS class for the icon. The default value is string.Empty.

    Remarks

    This property allows you to add a font icon or a sprite image to the action item by specifying one or more CSS classes separated by a space.

    Id

    Gets or sets the unique identifier for the menu item.

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

    A string that represents the unique ID of the item. The default value is string.Empty.

    Remarks

    This property allows you to assign a unique identifier to the menu item, which can be useful for scripting or styling purposes.

    Separator

    Gets or sets a value indicating whether to display a separator after the menu item.

    Declaration
    public bool Separator { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if a separator is displayed; otherwise, false. The default value is false.

    Remarks

    Separators are horizontal lines used to visually group related action items in the dropdown menu.

    Text

    Gets or sets the text to be displayed for the menu item.

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

    A string that represents the text of the item. The default value is string.Empty.

    Remarks

    This property specifies the visible text for the menu item.

    Url

    Gets or sets the URL to which the user will be navigated when the menu item is clicked.

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

    A string that represents the navigation URL. The default value is string.Empty.

    Remarks

    When this property is set, the menu item will be rendered as an anchor tag <a> that navigates to the specified URL upon being clicked.

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder

    Dispose(Boolean)

    A protected method that is called when the component is being disposed.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    A boolean value indicating whether the component is being disposed.

    Remarks

    This method removes the current item from its parent DropDownMenuItems collection and releases resources.

    OnInitializedAsync()

    A protected method that is called when the component is initialized.

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing the asynchronous operation.

    Remarks

    This method adds the current item to its parent DropDownMenuItems collection upon initialization.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved