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.
FormComponentWithAutoComplete<TValue>.AutoCompleteType
FormComponentWithAutoComplete<TValue>.AutoCompleteAttribute
FormComponentWithAutoComplete<TValue>.DefaultAutoCompleteAttribute
FormComponentWithAutoComplete<TValue>.DefaultAriaAutoCompleteAttribute
FormComponentWithAutoComplete<TValue>.AriaAutoCompleteAttribute
FormComponent<TValue>.GetValue
FormComponent<TValue>.OnContextMenu
FormComponent<TValue>.GetClassList
FormComponent<TValue>.TabIndex
FormComponent<TValue>.Placeholder
FormComponent<TValue>.Disabled
FormComponent<TValue>.EditContext
FormComponent<TValue>.ValueChanged
FormComponent<TValue>.FieldIdentifier
FormComponent<TValue>.ValueExpression
FormComponent<TValue>.FormFieldContext
FormComponent<TValue>.CurrentPlaceholder
RadzenComponent.OnAfterRenderAsync
RadzenComponent.RaiseContextMenu
RadzenComponent.RaiseMouseEnter
RadzenComponent.AddContextMenu
RadzenComponent.RaiseMouseLeave
RadzenComponent.OnBecameInvisible
RadzenComponent.DefaultCulture
RadzenComponent.IsJSRuntimeAvailable
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
public class RadzenNumeric<TValue> : FormComponentWithAutoComplete<TValue>, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent| Name | Description |
|---|---|
| TValue | The numeric type of the value. Supports int, long, short, byte, float, double, decimal and their nullable variants. |
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" />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.
public RadzenNumeric<TValue>()Gets or sets the function which returns TValue from string.
public Func<string, TValue> ConvertValue { get; set; }
| Type | Description |
|---|---|
| Func<string, TValue> | Gets or sets the function which returns TValue from string. |
Gets or sets the down button aria-label attribute.
public string DownAriaLabel { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the down button aria-label attribute. |
Gets or sets the format.
public string Format { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the format. |
Gets or sets the formatted value.
protected string FormattedValue { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the formatted value. |
Gets a value indicating whether this instance has value.
public bool HasValue { get; }
| Type | Description |
|---|---|
| bool | Gets a value indicating whether this instance has value. |
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.
public bool Immediate { get; set; }
| Type | Description |
|---|---|
| bool | 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. |
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.
public IReadOnlyDictionary<string, object> InputAttributes { get; set; }
| 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. |
Determines the maximum value.
public decimal? Max { get; set; }
| Type | Description |
|---|---|
| decimal? | Determines the maximum value. |
Gets or sets the maximum allowed text length.
public long? MaxLength { get; set; }
| Type | Description |
|---|---|
| long? | Gets or sets the maximum allowed text length. |
Determines the minimum value.
public decimal? Min { get; set; }
| Type | Description |
|---|---|
| decimal? | Determines the minimum value. |
Gets or sets a value indicating whether is read only.
public bool ReadOnly { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether is read only. |
Gets or sets a value indicating whether up down buttons are shown.
public bool ShowUpDown { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets a value indicating whether up down buttons are shown. |
Gets or sets the step.
public string Step { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the step. |
Gets or sets the text align.
public TextAlign TextAlign { get; set; }
| Type | Description |
|---|---|
| TextAlign | Gets or sets the text align. |
Gets or sets the up button aria-label attribute.
public string UpAriaLabel { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the up button aria-label attribute. |
Gets or sets the value.
public TValue Value { get; set; }
| Type | Description |
|---|---|
| TValue | Gets or sets the value. |
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
| Type | Name | Description |
|---|---|---|
| Rendering.RenderTreeBuilder | __builder |
Sets the focus on the input element.
public override ValueTask FocusAsync()
| Type | Description |
|---|---|
| ValueTask |
protected override string GetComponentCssClass()
| Type | Description |
|---|---|
| string |
Handles the change event.
protected Task OnChange(ChangeEventArgs args)
| Type | Name | Description |
|---|---|---|
| ChangeEventArgs | args | The ChangeEventArgs instance containing the event data. |
| Type | Description |
|---|---|
| Task |
public override Task SetParametersAsync(ParameterView parameters)
| Type | Name | Description |
|---|---|---|
| ParameterView | parameters |
| Type | Description |
|---|---|
| Task |