menu

Blazor

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

    Show / Hide Table of Contents

    Class DropDownButtonEvents

    Represents the event handlers for the SfDropDownButton.

    Inheritance
    System.Object
    DropDownButtonEvents
    Namespace: Syncfusion.Blazor.SplitButtons
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class DropDownButtonEvents : ComponentBase
    Remarks

    The DropDownButtonEvents class provides a way to handle various events triggered by the SfDropDownButton component, allowing for custom logic to be executed in response to user interactions.

    Constructors

    DropDownButtonEvents()

    Declaration
    public DropDownButtonEvents()

    Properties

    Closed

    An event callback that is raised when the SfDropDownButton popup is closed.

    Declaration
    public EventCallback<OpenCloseMenuEventArgs> Closed { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<OpenCloseMenuEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that is invoked when the popup is closed. The callback receives a OpenCloseMenuEventArgs.

    Remarks

    This event is triggered after the DropDownButton popup has been closed, allowing for custom logic to be executed. The OpenCloseMenuEventArgs provides access to popup-related values.

    Examples
    <SfDropDownButton>
        <DropDownMenuItems>
            <DropDownMenuItem Text="Dashboard"></DropDownMenuItem>
            <DropDownMenuItem Text="Notifications"></DropDownMenuItem>
            <DropDownMenuItem Text="User Settings"></DropDownMenuItem>
            <DropDownMenuItem Text="Log Out"></DropDownMenuItem>
        </DropDownMenuItems>
        <DropDownButtonEvents Closed="@Closed"></DropDownButtonEvents>
    </SfDropDownButton>
    @code {
        private void Closed(OpenCloseMenuEventArgs args) {
            // Custom logic here
        }
    }

    Created

    An event callback that is raised when the SfDropDownButton component is created.

    Declaration
    public EventCallback<object> Created { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    An Microsoft.AspNetCore.Components.EventCallback that is invoked when the component is created.

    Remarks

    This event is triggered after the DropDownButton has been initialized and rendered on the page, allowing for post-render logic.

    Examples
    <SfDropDownButton>
        <DropDownMenuItems>
            <DropDownMenuItem Text="Dashboard"></DropDownMenuItem>
            <DropDownMenuItem Text="Notifications"></DropDownMenuItem>
            <DropDownMenuItem Text="User Settings"></DropDownMenuItem>
            <DropDownMenuItem Text="Log Out"></DropDownMenuItem>
        </DropDownMenuItems>
        <DropDownButtonEvents Created="@Created"></DropDownButtonEvents>
    </SfDropDownButton>
    @code {
        private void Created() {
            // Custom logic here
        }
    }

    ItemSelected

    An event callback that is raised when an item in the SfDropDownButton is selected.

    Declaration
    public EventCallback<MenuEventArgs> ItemSelected { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<MenuEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that is invoked when an item is selected. The callback receives a MenuEventArgs.

    Remarks

    This event is triggered when the user clicks on an item in the dropdown list. The MenuEventArgs provides access to information about the selected item.

    Examples
    <SfDropDownButton>
        <DropDownMenuItems>
            <DropDownMenuItem Text="Dashboard"></DropDownMenuItem>
            <DropDownMenuItem Text="Notifications"></DropDownMenuItem>
            <DropDownMenuItem Text="User Settings"></DropDownMenuItem>
            <DropDownMenuItem Text="Log Out"></DropDownMenuItem>
        </DropDownMenuItems>
        <DropDownButtonEvents ItemSelected="@ItemSelected"></DropDownButtonEvents>
    </SfDropDownButton>
    @code {
        private void ItemSelected(MenuEventArgs args) {
            // Custom logic here
        }
    }

    OnClose

    An event callback that is raised when the SfDropDownButton popup is closing.

    Declaration
    public EventCallback<BeforeOpenCloseMenuEventArgs> OnClose { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<BeforeOpenCloseMenuEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that is invoked when the popup is closing. The callback receives a BeforeOpenCloseMenuEventArgs.

    Remarks

    This event is triggered before the DropDownButton popup closes, allowing you to perform actions or validations. The BeforeOpenCloseMenuEventArgs provides access to popup-related values.

    Examples
    <SfDropDownButton>
        <DropDownMenuItems>
            <DropDownMenuItem Text="Dashboard"></DropDownMenuItem>
            <DropDownMenuItem Text="Notifications"></DropDownMenuItem>
            <DropDownMenuItem Text="User Settings"></DropDownMenuItem>
            <DropDownMenuItem Text="Log Out"></DropDownMenuItem>
        </DropDownMenuItems>
        <DropDownButtonEvents OnClose="@OnClose"></DropDownButtonEvents>
    </SfDropDownButton>
    @code {
        private void OnClose(BeforeOpenCloseMenuEventArgs args) {
            // Custom logic here
        }
    }

    OnItemRender

    An event callback that is raised before each item in the SfDropDownButton is rendered.

    Declaration
    public EventCallback<MenuEventArgs> OnItemRender { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<MenuEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that is invoked before each item is rendered. The callback receives a MenuEventArgs.

    Remarks

    This event allows for customization of the list items before they are displayed. The MenuEventArgs provides access to item-related values.

    Examples
    <SfDropDownButton>
        <DropDownMenuItems>
            <DropDownMenuItem Text="Dashboard"></DropDownMenuItem>
            <DropDownMenuItem Text="Notifications"></DropDownMenuItem>
            <DropDownMenuItem Text="User Settings"></DropDownMenuItem>
            <DropDownMenuItem Text="Log Out"></DropDownMenuItem>
        </DropDownMenuItems>
        <DropDownButtonEvents OnItemRender="@OnItemRender"></DropDownButtonEvents>
    </SfDropDownButton>
    @code {
        private void OnItemRender(MenuEventArgs args) {
            // Custom logic here
        }
    }

    OnOpen

    An event callback that is raised when the SfDropDownButton popup is opening.

    Declaration
    public EventCallback<BeforeOpenCloseMenuEventArgs> OnOpen { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<BeforeOpenCloseMenuEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that is invoked when the popup is opening. The callback receives a BeforeOpenCloseMenuEventArgs.

    Remarks

    This event is triggered before the DropDownButton popup opens, allowing you to perform actions or validations. The BeforeOpenCloseMenuEventArgs provides access to popup-related values.

    Examples
    <SfDropDownButton>
        <DropDownMenuItems>
            <DropDownMenuItem Text="Dashboard"></DropDownMenuItem>
            <DropDownMenuItem Text="Notifications"></DropDownMenuItem>
            <DropDownMenuItem Text="User Settings"></DropDownMenuItem>
            <DropDownMenuItem Text="Log Out"></DropDownMenuItem>
        </DropDownMenuItems>
        <DropDownButtonEvents OnOpen="@OnOpen"></DropDownButtonEvents>
    </SfDropDownButton>
    @code {
        private void OnOpen(BeforeOpenCloseMenuEventArgs args) {
            // Custom logic here
        }
    }

    Opened

    An event callback that is raised when the SfDropDownButton popup is opened.

    Declaration
    public EventCallback<OpenCloseMenuEventArgs> Opened { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<OpenCloseMenuEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that is invoked when the popup is opened. The callback receives a OpenCloseMenuEventArgs.

    Remarks

    This event is triggered after the DropDownButton popup has been opened, allowing for custom logic to be executed. The OpenCloseMenuEventArgs provides access to popup-related values.

    Examples
    <SfDropDownButton>
        <DropDownMenuItems>
            <DropDownMenuItem Text="Dashboard"></DropDownMenuItem>
            <DropDownMenuItem Text="Notifications"></DropDownMenuItem>
            <DropDownMenuItem Text="User Settings"></DropDownMenuItem>
            <DropDownMenuItem Text="Log Out"></DropDownMenuItem>
        </DropDownMenuItems>
        <DropDownButtonEvents Opened="@Opened"></DropDownButtonEvents>
    </SfDropDownButton>
    @code {
        private void Opened(OpenCloseMenuEventArgs args) {
            // Custom logic here
        }
    }

    Methods

    OnInitializedAsync()

    Initializes the component and assigns the delegates to the parent SfDropDownButton.

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

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

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