Skip to main content
A newer version of this page is available.
All docs
V20.2

DxPopup.CloseButtonClick Event

Fires when a user clicks the Close button in a pop-up window’s header.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v20.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public EventCallback CloseButtonClick { get; set; }

Remarks

Use the CloseButtonClick event to handle the Close button click.

<div class="target-container" @onclick="@(() => PopupVisible = true)"></div>
<DxPopup HeaderText="Header"
         @bind-Visible="@PopupVisible"
         CloseButtonClick="@(() => SendMessage("The operation is cancelled."))">
    <Content>
        <p>
            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.
        </p>
    </Content>
    <FooterTemplate>
        <div class="modal-footer">
            <button class="btn btn-primary" @onclick="@(() => SendMessage("The operation is completed."))">OK</button>
        </div>
    </FooterTemplate>
</DxPopup>


@code {
    bool PopupVisible { get; set; } = false;

    void SendMessage(string text) {
        PopupVisible = false;
        // ...
    }
}
See Also