Events in Blazor Numeric Textbox

27 Aug 20261 minute to read

This section lists the events raised by the Blazor Numeric TextBox component and when they occur. Events are wired using the nested NumericTextBoxEvents tag inside the SfNumericTextBox.

Blur

The Blur event occurs when the NumericTextBox loses focus.

@using Syncfusion.Blazor.Inputs

<SfNumericTextBox TValue="int?">
    <NumericTextBoxEvents TValue="int?" Blur="@BlurHandler"></NumericTextBoxEvents>
</SfNumericTextBox>

@code {
    private void BlurHandler(NumericBlurEventArgs<int?> args)
    {
        // Here you can customize your code
    }
}

Created

The Created event fires after the Blazor Numeric TextBox component has been initialized and rendered.

@using Syncfusion.Blazor.Inputs

<SfNumericTextBox TValue="int?">
    <NumericTextBoxEvents TValue="int?" Created="@CreatedHandler"></NumericTextBoxEvents>
</SfNumericTextBox>

@code {
    private void CreatedHandler(object args)
    {
        // Here you can customize your code
    }
}

Destroyed

The Destroyed event fires when the Blazor Numeric TextBox component is disposed.

@using Syncfusion.Blazor.Inputs

<SfNumericTextBox TValue="int?">
    <NumericTextBoxEvents TValue="int?" Destroyed="@DestroyedHandler"></NumericTextBoxEvents>
</SfNumericTextBox>

@code {
    private void DestroyedHandler(object args)
    {
        // Here you can customize your code
    }
}

Focus

The Focus event occurs when the NumericTextBox receives focus.

@using Syncfusion.Blazor.Inputs

<SfNumericTextBox TValue="int?">
    <NumericTextBoxEvents TValue="int?" Focus="@FocusHandler"></NumericTextBoxEvents>
</SfNumericTextBox>

@code {
    private void FocusHandler(NumericFocusEventArgs<int?> args)
    {
        // Here you can customize your code
    }
}

ValueChange

The ValueChange event triggers when the value changes or the component loses focus.

@using Syncfusion.Blazor.Inputs

<SfNumericTextBox TValue="int?">
    <NumericTextBoxEvents TValue="int?" ValueChange="@ValueChangeHandler"></NumericTextBoxEvents>
</SfNumericTextBox>

@code {
    private void ValueChangeHandler(ChangeEventArgs<int?> args)
    {
        // Here you can customize your code
    }
}

NOTE

Blazor Numeric TextBox is limited to these events. Additional events may be added in the future based on user requests. If the event you are looking for is not on the list, then request here.