RadzenNumeric<TValue> Class

A numeric input component that allows users to enter numbers with optional increment/decrement buttons and value constraints. RadzenNumeric supports various numeric types, formatting, min/max validation, step increments, and culture-specific number display. Provides up/down arrow buttons for incrementing/decrementing the value by a specified step amount. Supports min/max constraints that are enforced during input and stepping, formatted value display using standard .NET format strings, and can be configured with or without the up/down buttons. Handles overflow protection and respects the numeric type's natural limits.

Inheritance

Implements

IComponent

IHandleEvent

IHandleAfterRender

IRadzenFormComponent

Inherited Members

FormComponentWithAutoComplete<TValue>.AutoCompleteType

FormComponentWithAutoComplete<TValue>.AutoCompleteAttribute

FormComponentWithAutoComplete<TValue>.DefaultAutoCompleteAttribute

FormComponentWithAutoComplete<TValue>.DefaultAriaAutoCompleteAttribute

FormComponentWithAutoComplete<TValue>.AriaAutoCompleteAttribute

FormComponent<TValue>.Dispose

FormComponent<TValue>.GetValue

FormComponent<TValue>.OnContextMenu

FormComponent<TValue>.GetClassList

FormComponent<TValue>.Name

FormComponent<TValue>.TabIndex

FormComponent<TValue>.Placeholder

FormComponent<TValue>.Disabled

FormComponent<TValue>.EditContext

FormComponent<TValue>.Form

FormComponent<TValue>.ValueChanged

FormComponent<TValue>.IsBound

FormComponent<TValue>.Change

FormComponent<TValue>.FieldIdentifier

FormComponent<TValue>.ValueExpression

FormComponent<TValue>.FormFieldContext

FormComponent<TValue>.CurrentPlaceholder

FormComponent<TValue>._value

RadzenComponent.OnMouseEnter

RadzenComponent.OnMouseLeave

RadzenComponent.GetCssClass

RadzenComponent.GetId

RadzenComponent.Debounce

RadzenComponent.OnInitialized

RadzenComponent.OnAfterRenderAsync

RadzenComponent.RaiseContextMenu

RadzenComponent.RaiseMouseEnter

RadzenComponent.AddContextMenu

RadzenComponent.RaiseMouseLeave

RadzenComponent.OnBecameInvisible

RadzenComponent.Attributes

RadzenComponent.Element

RadzenComponent.MouseEnter

RadzenComponent.MouseLeave

RadzenComponent.ContextMenu

RadzenComponent.Culture

RadzenComponent.DefaultCulture

RadzenComponent.Style

RadzenComponent.Visible

RadzenComponent.UniqueID

RadzenComponent.JSRuntime

RadzenComponent.IsJSRuntimeAvailable

RadzenComponent.Reference

RadzenComponent.CurrentStyle

ComponentBase.OnInitializedAsync

ComponentBase.OnParametersSet

ComponentBase.OnParametersSetAsync

ComponentBase.StateHasChanged

ComponentBase.ShouldRender

ComponentBase.OnAfterRender

ComponentBase.InvokeAsync

ComponentBase.DispatchExceptionAsync

ComponentBase.RendererInfo

ComponentBase.Assets

ComponentBase.AssignedRenderMode

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenNumeric<TValue> : FormComponentWithAutoComplete<TValue>, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent

Type Parameters

Name Description
TValueThe numeric type of the value. Supports int, long, short, byte, float, double, decimal and their nullable variants.

Examples

Basic integer numeric input with constraints:

<RadzenNumeric @bind-Value=@quantity TValue="int" Min="1" Max="100" Step="1" />

Decimal input with custom formatting:

<RadzenNumeric @bind-Value=@price TValue="decimal" Min="0" Format="c" Placeholder="Enter price" />

Nullable numeric without increment buttons:

<RadzenNumeric @bind-Value=@optionalValue TValue="int?" ShowUpDown="false" Placeholder="Optional" />

Constructors

RadzenNumeric<TValue>link

A numeric input component that allows users to enter numbers with optional increment/decrement buttons and value constraints. RadzenNumeric supports various numeric types, formatting, min/max validation, step increments, and culture-specific number display. Provides up/down arrow buttons for incrementing/decrementing the value by a specified step amount. Supports min/max constraints that are enforced during input and stepping, formatted value display using standard .NET format strings, and can be configured with or without the up/down buttons. Handles overflow protection and respects the numeric type's natural limits.

Declaration
public RadzenNumeric<TValue>()

Fields

inputlink

Gets input reference.

Declaration
protected ElementReference input

Properties

ConvertValuelink

Gets or sets the function which returns TValue from string.

Declaration
public Func<string, TValue> ConvertValue { get; set; }
Property Value
Type Description
Func<string, TValue>Gets or sets the function which returns TValue from string.

DownAriaLabellink

Gets or sets the down button aria-label attribute.

Declaration
public string DownAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the down button aria-label attribute.

Formatlink

Gets or sets the format.

Declaration
public string Format { get; set; }
Property Value
Type Description
stringGets or sets the format.

FormattedValuelink

Gets or sets the formatted value.

Declaration
protected string FormattedValue { get; set; }
Property Value
Type Description
stringGets or sets the formatted value.

HasValuelink

Gets a value indicating whether this instance has value.

Declaration
public bool HasValue { get; }
Property Value
Type Description
boolGets a value indicating whether this instance has value.

Immediatelink

Gets or sets whether the component should update the bound value immediately as the user types (oninput event), rather than waiting for the input to lose focus (onchange event). This enables real-time value updates but may trigger more frequent change events.

Declaration
public bool Immediate { get; set; }
Property Value
Type Description
boolGets or sets whether the component should update the bound value immediately as the user types (oninput event), rather than waiting for the input to lose focus (onchange event). This enables real-time value updates but may trigger more frequent change events.

InputAttributeslink

Gets or sets additional HTML attributes to be applied to the underlying input element. This allows passing custom attributes like data-* attributes, aria-* attributes, or other HTML attributes directly to the input.

Declaration
public IReadOnlyDictionary<string, object> InputAttributes { get; set; }
Property Value
Type Description
IReadOnlyDictionary<string, object>Gets or sets additional HTML attributes to be applied to the underlying input element. This allows passing custom attributes like data-* attributes, aria-* attributes, or other HTML attributes directly to the input.

Maxlink

Determines the maximum value.

Declaration
public decimal? Max { get; set; }
Property Value
Type Description
decimal?Determines the maximum value.

MaxLengthlink

Gets or sets the maximum allowed text length.

Declaration
public long? MaxLength { get; set; }
Property Value
Type Description
long?Gets or sets the maximum allowed text length.

Minlink

Determines the minimum value.

Declaration
public decimal? Min { get; set; }
Property Value
Type Description
decimal?Determines the minimum value.

ReadOnlylink

Gets or sets a value indicating whether is read only.

Declaration
public bool ReadOnly { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether is read only.

ShowUpDownlink

Gets or sets a value indicating whether up down buttons are shown.

Declaration
public bool ShowUpDown { get; set; }
Property Value
Type Description
boolGets or sets a value indicating whether up down buttons are shown.

Steplink

Gets or sets the step.

Declaration
public string Step { get; set; }
Property Value
Type Description
stringGets or sets the step.

TextAlignlink

Gets or sets the text align.

Declaration
public TextAlign TextAlign { get; set; }
Property Value
Type Description
TextAlignGets or sets the text align.

UpAriaLabellink

Gets or sets the up button aria-label attribute.

Declaration
public string UpAriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the up button aria-label attribute.

Valuelink

Gets or sets the value.

Declaration
public TValue Value { get; set; }
Property Value
Type Description
TValueGets or sets the value.

Methods

BuildRenderTreelink

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

FocusAsynclink

Sets the focus on the input element.

Declaration
public override ValueTask FocusAsync()
Returns
Type Description
ValueTask

GetComponentCssClasslink

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string

OnChangelink

Handles the change event.

Declaration
protected Task OnChange(ChangeEventArgs args)
Parameters
Type Name Description
ChangeEventArgs args The ChangeEventArgs instance containing the event data.
Returns
Type Description
Task

SetParametersAsynclink

Declaration
public override Task SetParametersAsync(ParameterView parameters)
Parameters
Type Name Description
ParameterView parameters
Returns
Type Description
Task
An error has occurred. This app may no longer respond until reloaded. Reload 🗙