Change text content and styles of the Blazor ProgressButton Component

21 Dec 20211 minute to read

You can change the text content and styles of the Progress Button during progress state by changing the text content and the CssClass property at the OnBegin and OnEnd events.

@using Syncfusion.Blazor.SplitButtons

<SfProgressButton Content="@Content" EnableProgress="true" CssClass="@CssClass" Duration="4000">
    <ProgressButtonEvents OnBegin="Begin" OnEnd="End"></ProgressButtonEvents>

@code {
    public string Content = "Upload";
    public string CssClass = "e-hide-spinner";
    public void Begin(Syncfusion.Blazor.SplitButtons.ProgressEventArgs args)
        Content = "Uploading...";
        CssClass = "e-hide-spinner e-info";
    public async Task End(Syncfusion.Blazor.SplitButtons.ProgressEventArgs args)
        Content = "Success";
        CssClass = "e-hide-spinner e-success";
        await Task.Delay(1000);
        Content = "Upload";
        CssClass = "e-hide-spinner";

Changing Text Content and Style of Blazor ProgressButton