alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class NumericTextBoxEvents<TValue>

    Provides event callback definitions for the SfNumericTextBox<TValue> component. This class contains various event handlers that can be invoked during different lifecycle stages and user interactions with the NumericTextBox.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    SfBaseComponent
    SfInputTextBase<TValue>
    NumericTextBoxEvents<TValue>
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.BuildRenderTree(RenderTreeBuilder)
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnInitialized()
    ComponentBase.OnParametersSet()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    SfBaseComponent.Dispose()
    SfBaseComponent.Dispose(bool)
    SfBaseComponent.GetEffectivePlatform()
    SfBaseComponent.GetMainComponentPlatform()
    SfBaseComponent.IsMainLicenseComponent()
    SfBaseComponent.LicenseContext
    SfBaseComponent.OnObservableChange(string, object, bool, NotifyCollectionChangedEventArgs)
    SfBaseComponent.ValidateLicense()
    SfInputTextBase<TValue>._value
    SfInputTextBase<TValue>.APPEND
    SfInputTextBase<TValue>.APPEND_ICON
    SfInputTextBase<TValue>.ARIA_DISABLED
    SfInputTextBase<TValue>.BaseAutocomplete
    SfInputTextBase<TValue>.BaseFloatLabelType
    SfInputTextBase<TValue>.BaseHtmlAttributes
    SfInputTextBase<TValue>.BaseInputAttributes
    SfInputTextBase<TValue>.BaseIsReadOnlyInput
    SfInputTextBase<TValue>.BasePlaceholder
    SfInputTextBase<TValue>.BaseReadonly
    SfInputTextBase<TValue>.BaseShowClearButton
    SfInputTextBase<TValue>.BaseTabIndex
    SfInputTextBase<TValue>.BaseWidth
    SfInputTextBase<TValue>.ChangeHandler(ChangeEventArgs)
    SfInputTextBase<TValue>.CLEAR_ICON_HIDE
    SfInputTextBase<TValue>.ClearElement
    SfInputTextBase<TValue>.CLEARICONHIDE
    SfInputTextBase<TValue>.ComponentReference
    SfInputTextBase<TValue>.ContainerAttr
    SfInputTextBase<TValue>.containerAttributes
    SfInputTextBase<TValue>.CONTROL_CONTAINER
    SfInputTextBase<TValue>.CONTROL_OLD_CONTAINER
    SfInputTextBase<TValue>.CssClass
    SfInputTextBase<TValue>.DataId
    SfInputTextBase<TValue>.DECREMENT
    SfInputTextBase<TValue>.DECREMENT_TITLE
    SfInputTextBase<TValue>.DecrementTitle
    SfInputTextBase<TValue>.DISABLE
    SfInputTextBase<TValue>.DISABLE_ICON
    SfInputTextBase<TValue>.DISABLED_ATTR
    SfInputTextBase<TValue>.Enabled
    SfInputTextBase<TValue>.EnablePersistence
    SfInputTextBase<TValue>.EnableRtl
    SfInputTextBase<TValue>.FLOATINPUT
    SfInputTextBase<TValue>.FloatLabel
    SfInputTextBase<TValue>.FLOATLABELBOTTOM
    SfInputTextBase<TValue>.FLOATLABELTOP
    SfInputTextBase<TValue>.FLOATTEXT
    SfInputTextBase<TValue>.FocusHandler(FocusEventArgs)
    SfInputTextBase<TValue>.FocusOutHandler(FocusEventArgs)
    SfInputTextBase<TValue>.FormatValue(string)
    SfInputTextBase<TValue>.FormatValueAsString(TValue)
    SfInputTextBase<TValue>.GROUP_ICON
    SfInputTextBase<TValue>.ID
    SfInputTextBase<TValue>.INCREMENT
    SfInputTextBase<TValue>.INCREMENT_TITLE
    SfInputTextBase<TValue>.IncrementTitle
    SfInputTextBase<TValue>.INPUT
    SfInputTextBase<TValue>.inputAttr
    SfInputTextBase<TValue>.InputEditContext
    SfInputTextBase<TValue>.INPUTFOCUS
    SfInputTextBase<TValue>.INPUTGROUP
    SfInputTextBase<TValue>.InputHandler(ChangeEventArgs)
    SfInputTextBase<TValue>.IsClearButtonClicked
    SfInputTextBase<TValue>.IsFocused
    SfInputTextBase<TValue>.ListOfButtons
    SfInputTextBase<TValue>.MULTILINE
    SfInputTextBase<TValue>.MultilineInput
    SfInputTextBase<TValue>.OnAfterRenderAsync(bool)
    SfInputTextBase<TValue>.OnChangeHandler(ChangeEventArgs)
    SfInputTextBase<TValue>.OnInitializedAsync()
    SfInputTextBase<TValue>.OnInputHandler(ChangeEventArgs)
    SfInputTextBase<TValue>.OnParametersSetAsync()
    SfInputTextBase<TValue>.OnPasteHandler(ClipboardEventArgs)
    SfInputTextBase<TValue>.PREPEND
    SfInputTextBase<TValue>.PREPEND_ICON
    SfInputTextBase<TValue>.SetEnabled()
    SfInputTextBase<TValue>.SPACE
    SfInputTextBase<TValue>.SPIN_DOWN
    SfInputTextBase<TValue>.SPIN_UP
    SfInputTextBase<TValue>.ValidateOnInput
    SfInputTextBase<TValue>.Value
    SfInputTextBase<TValue>.ValueChanged
    SfInputTextBase<TValue>.WireClearBtnEvents()
    Namespace: Syncfusion.Blazor.Inputs
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class NumericTextBoxEvents<TValue> : SfInputTextBase<TValue>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
    Type Parameters
    Name Description
    TValue

    Specifies the type of value that the SfNumericTextBox<TValue> component handles.

    Remarks

    The NumericTextBoxEvents class allows developers to handle various events such as focus, blur, value changes, and component lifecycle events. This event container is used as a child component within the SfNumericTextBox<TValue> to define event callbacks.

    Examples

    Example of using NumericTextBoxEvents with event callbacks:

    <SfNumericTextBox TValue="int?" Placeholder="Enter a number">
        <NumericTextBoxEvents TValue="int?" 
                             ValueChange="@OnValueChange"
                             Focus="@OnFocus"
                             Blur="@OnBlur"
                             Created="@OnCreated" />
    </SfNumericTextBox>
    
    @code {
        private void OnValueChange(ChangeEventArgs<int?> args)
        {
            // Handle value change
        }
    
        private void OnFocus(NumericFocusEventArgs<int?> args)
        {
            // Handle focus event
        }
    
        private void OnBlur(NumericBlurEventArgs<int?> args)
        {
            // Handle blur event
        }
    
        private void OnCreated(object args)
        {
            // Handle component creation
        }
    }

    Constructors

    NumericTextBoxEvents()

    Declaration
    public NumericTextBoxEvents()

    Properties

    BaseParent

    Gets or sets the parent SfNumericTextBox<TValue> component instance that contains this event container.

    Declaration
    [CascadingParameter]
    protected SfNumericTextBox<TValue>? BaseParent { get; set; }
    Property Value
    Type Description
    SfNumericTextBox<TValue>

    A reference to the parent SfNumericTextBox<TValue> component. The default value is null.

    Remarks

    This property is automatically set by the Blazor framework through cascading parameters when the NumericTextBoxEvents component is used as a child of SfNumericTextBox<TValue>. It establishes the connection between the event container and its parent NumericTextBox component.

    Blur

    Gets or sets an event callback that is invoked when the SfNumericTextBox<TValue> component loses focus.

    Declaration
    [Parameter]
    public EventCallback<NumericBlurEventArgs<TValue>> Blur { get; set; }
    Property Value
    Type Description
    EventCallback<NumericBlurEventArgs<TValue>>

    An EventCallback<TValue> that receives NumericBlurEventArgs<T> containing information about the blur event.

    Remarks

    The Blur event is triggered when the NumericTextBox loses focus, typically when the user clicks outside the component or navigates to another control using the Tab key. You can use this event to perform validation, save data, or update the UI based on the component losing focus.

    Examples

    Example of handling the Blur event:

    <SfNumericTextBox TValue="int?">
        <NumericTextBoxEvents TValue="int?" Blur="@OnBlur" />
    </SfNumericTextBox>
    
    @code {
        private void OnBlur(NumericBlurEventArgs<int?> args)
        {
            // Perform validation or other actions when component loses focus
            Console.WriteLine($"NumericTextBox lost focus. Current value: {args.Value}");
        }
    }

    Created

    Gets or sets an event callback that is invoked when the SfNumericTextBox<TValue> component is created and fully initialized.

    Declaration
    [Parameter]
    public EventCallback<object> Created { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    An EventCallback<TValue> that receives an object parameter when the component creation is complete.

    Remarks

    The Created event is triggered after the NumericTextBox component has been fully rendered and initialized on the client-side. This event is useful for performing initialization tasks, setting up additional configurations, or integrating with third-party libraries that require the component to be fully rendered.

    Examples

    Example of handling the Created event:

    <SfNumericTextBox TValue="decimal?">
        <NumericTextBoxEvents TValue="decimal?" Created="@OnCreated" />
    </SfNumericTextBox>
    
    @code {
        private void OnCreated(object args)
        {
            // Component is fully created and rendered
            Console.WriteLine("NumericTextBox component has been created successfully");
        }
    }

    Destroyed

    Gets or sets an event callback that is invoked when the SfNumericTextBox<TValue> component is destroyed or disposed.

    Declaration
    [Parameter]
    public EventCallback<object> Destroyed { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    An EventCallback<TValue> that receives an object parameter when the component destruction occurs.

    Remarks

    The Destroyed event is triggered when the NumericTextBox component is being removed from the DOM or disposed of. This event is useful for performing cleanup tasks, removing event listeners, or disposing of resources that were allocated during the component's lifecycle.

    Examples

    Example of handling the Destroyed event:

    <SfNumericTextBox TValue="double?">
        <NumericTextBoxEvents TValue="double?" Destroyed="@OnDestroyed" />
    </SfNumericTextBox>
    
    @code {
        private void OnDestroyed(object args)
        {
            // Perform cleanup when component is destroyed
            Console.WriteLine("NumericTextBox component has been destroyed");
        }
    }

    Focus

    Gets or sets an event callback that is invoked when the SfNumericTextBox<TValue> component receives focus.

    Declaration
    [Parameter]
    public EventCallback<NumericFocusEventArgs<TValue>> Focus { get; set; }
    Property Value
    Type Description
    EventCallback<NumericFocusEventArgs<TValue>>

    An EventCallback<TValue> that receives NumericFocusEventArgs<T> containing information about the focus event.

    Remarks

    The Focus event is triggered when the NumericTextBox receives focus, typically when the user clicks on the component or navigates to it using the Tab key. You can use this event to highlight the component, show additional UI elements, or perform initialization tasks that should occur when the component becomes active.

    Examples

    Example of handling the Focus event:

    <SfNumericTextBox TValue="float?">
        <NumericTextBoxEvents TValue="float?" Focus="@OnFocus" />
    </SfNumericTextBox>
    
    @code {
        private void OnFocus(NumericFocusEventArgs<float?> args)
        {
            // Handle focus event
            Console.WriteLine($"NumericTextBox received focus. Current value: {args.Value}");
        }
    }

    ValueChange

    Gets or sets an event callback that is invoked when the value of the SfNumericTextBox<TValue> component changes.

    Declaration
    [Parameter]
    public EventCallback<ChangeEventArgs<TValue>> ValueChange { get; set; }
    Property Value
    Type Description
    EventCallback<ChangeEventArgs<TValue>>

    An EventCallback<TValue> that receives ChangeEventArgs<T> containing the old and new values when the component's value changes.

    Remarks

    The ValueChange event is triggered whenever the user modifies the numeric value in the TextBox, either by typing, using the spin buttons, or through programmatic changes. This event provides both the previous and current values, allowing you to track changes and implement custom logic based on value modifications.

    Examples

    Example of handling the ValueChange event:

    <SfNumericTextBox TValue="int?" Placeholder="Enter the value">
        <NumericTextBoxEvents TValue="int?" ValueChange="@OnValueChange" />
    </SfNumericTextBox>
    
    @code {
        private void OnValueChange(ChangeEventArgs<int?> args)
        {
            var previousValue = args.PreviousValue;
            var currentValue = args.Value;
            Console.WriteLine($"Value changed from {previousValue} to {currentValue}");
        }
    }

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved