menu

Blazor

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

    Show / Hide Table of Contents

    Class PopupEventArgs

    Provides event arguments for popup open and close events in picker components.

    Inheritance
    System.Object
    PopupEventArgs
    Namespace: Syncfusion.Blazor.Calendars
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class PopupEventArgs : Object
    Remarks

    This class contains information about popup state changes in various picker components such as time pickers. It provides control over popup behavior, including the ability to cancel the action and specify where the popup should be appended in the DOM. The event arguments also include access to the original browser event.

    Examples
    <SfTimePicker TValue="DateTime?">
        <TimePickerEvents TValue="DateTime?" OnOpen="OnPopupOpen" OnClose="OnPopupClose"></TimePickerEvents>
    </SfTimePicker>
    
    @code {
        void OnPopupOpen(PopupEventArgs args)
        {
            Console.WriteLine("Time picker popup is opening");
            // Optionally cancel the opening
            // args.Cancel = true;
        }
    
        void OnPopupClose(PopupEventArgs args)
        {
            Console.WriteLine("Time picker popup is closing");
        }
    }

    Constructors

    PopupEventArgs()

    Declaration
    public PopupEventArgs()

    Properties

    AppendTo

    Gets or sets the DOM node to which the popup element should be appended.

    Declaration
    public DOM AppendTo { get; set; }
    Property Value
    Type Description
    DOM

    A DOM object representing the target node for popup appendage. The default value is null.

    Remarks

    This property allows you to specify a custom container where the popup should be rendered in the DOM. If not specified, the popup will be appended to the default container (typically the body element). This is useful for controlling the popup's position, z-index context, and ensuring proper rendering within complex layouts or modal dialogs.

    Cancel

    Gets or sets a value indicating whether the popup action should be canceled.

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

    true if the popup action should be canceled; otherwise, false.

    Remarks

    This property allows you to prevent the popup from opening or closing by setting it to true. This is useful for implementing conditional popup behavior based on application state, validation results, or user permissions. When canceled, the popup action will be prevented and the popup state will remain unchanged.

    Event

    Gets or sets the original browser event that triggered the popup action.

    Declaration
    public object Event { get; set; }
    Property Value
    Type Description
    System.Object

    An object containing the original event arguments from the browser. The default value is null.

    Remarks

    This property contains the raw browser event information that caused the popup to open or close. It provides access to the underlying event details, such as click events, keyboard interactions, or focus events, for advanced event handling scenarios.

    Name

    Gets or sets the name of the popup event.

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

    A string value representing the event name. The default value is null.

    Remarks

    This property specifies the name identifier for the popup event, which can be used to identify whether this is an open or close event in scenarios where the same event handler is used for both actions.

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