Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxToastProvider.ShowCloseButton Property

Specifies whether toasts display the Close button.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(true)]
[Parameter]
public bool ShowCloseButton { get; set; }

#Property Value

Type Default Description
Boolean true

true to display the Close button; otherwise, false.

#Remarks

Set the ShowCloseButton to false to hide the Close button from toast notifications. This value can be overwritten at a toast level by the DxToast.ShowCloseButton or ToastOptions.ShowCloseButton property.

razor
<style>
    .italic-text {
        font-style: italic;
        text-align: center;
    }
</style>

<DxButton RenderStyle="ButtonRenderStyle.Secondary" Text="Show a toast" Click="AddToast" />
<DxToastProvider ShowIcon="false" ShowCloseButton="false" ThemeMode=ToastThemeMode.Pastel/>

@code {
    [Inject] IToastNotificationService ToastService { get; set; }
    private void AddToast() {
        ToastService.ShowToast(new ToastOptions {
            Title = "Notification",
            Text = "The process is completed.",
            CssClass = "italic-text"
        });
    }
}

Customized toast notification

See Also