Class SfNumericTextBox<TValue>
The NumericTextBox is used to get the number inputs from the user. The input values can be incremented or decremented by a predefined step value.
Inherited Members
Namespace: Syncfusion.Blazor.Inputs
Assembly: Syncfusion.Blazor.dll
Syntax
public class SfNumericTextBox<TValue> : SfInputTextBase<TValue>
Type Parameters
Name | Description |
---|---|
TValue | Specifies the type of SfNumericTextBox. |
Constructors
SfNumericTextBox()
Declaration
public SfNumericTextBox()
Properties
BaseFloatLabelType
Declaration
protected override FloatLabelType BaseFloatLabelType { get; set; }
Property Value
Type | Description |
---|---|
FloatLabelType |
Overrides
BaseHtmlAttributes
Declaration
protected override Dictionary<string, object> BaseHtmlAttributes { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Object> |
Overrides
BaseInputAttributes
Declaration
protected override Dictionary<string, object> BaseInputAttributes { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Object> |
Overrides
BaseIsReadOnlyInput
Declaration
protected override bool BaseIsReadOnlyInput { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
BasePlaceholder
Declaration
protected override string BasePlaceholder { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
BaseReadonly
Declaration
protected override bool BaseReadonly { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
BaseShowClearButton
Declaration
protected override bool BaseShowClearButton { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
BaseTabIndex
Declaration
protected override int BaseTabIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Overrides
BaseWidth
Declaration
protected override string BaseWidth { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Overrides
Currency
Specifies the currency code to use in currency formatting. Possible values are the ISO 4217 currency codes, such as 'USD' for the US dollar and 'EUR' for the euro.
Declaration
public string Currency { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts the string value. |
Decimals
Specifies the number precision applied to the textbox value when the NumericTextBox is focused.
Declaration
public Nullable<int> Decimals { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int32> | An integer value representing the decimal values of NumericTextBox component. |
FloatLabelType
Specifies the floating label behavior of the TextBox that the placeholder text floats above the TextBox based on the following values.
Possible values are:
- NeverNever floats the label in the TextBox when the placeholder is available.
- AlwaysThe floating label always floats above the TextBox.
- AutoThe floating label floats above the TextBox after focusing it or when enters the value in it.
Declaration
public FloatLabelType FloatLabelType { get; set; }
Property Value
Type | Description |
---|---|
FloatLabelType | One of the FloatLabelType enum. |
Format
Specifies the number format that indicates the display format for the value of the NumericTextBox.
Declaration
public string Format { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts the string value. The default value is |
HtmlAttributes
You can add the additional html attributes such as styles, class, and more to the root element. If you configured both property and equivalent html attributes, then the component considers the property value.
Declaration
public Dictionary<string, object> HtmlAttributes { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Object> | A dictionary of additional HTML attributes for the root element of the component. |
InputAttributes
You can add the additional input attributes such as disabled, value, and more to the root element. If you configured both property and equivalent input attribute, then the component considers the property value.
Declaration
public Dictionary<string, object> InputAttributes { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Object> | A dictionary of additional input attributes for the root element of the component. |
Max
Specifies a maximum value that is allowed a user can enter.
Declaration
public TValue Max { get; set; }
Property Value
Type | Description |
---|---|
TValue | Allows the user to provide the maximum value. |
Min
Specifies a minimum value that is allowed a user can enter.
Declaration
public TValue Min { get; set; }
Property Value
Type | Description |
---|---|
TValue | Allows the user to provide the minimum value. |
Placeholder
Specifies the boolean value whether the TextBox allows user to change the text.
Declaration
public string Placeholder { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts the string value. |
Readonly
Specifies the boolean value whether the TextBox allows user to change the text.
Declaration
public bool Readonly { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
ShowClearButton
Specifies a boolean value that indicates whether the clear button is displayed in TextBox.
Declaration
public bool ShowClearButton { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
ShowSpinButton
Specifies whether the up and down spin buttons will be displayed in NumericTextBox.
Declaration
public bool ShowSpinButton { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Step
Specifies the incremental or decremental step size for the NumericTextBox.
Declaration
public TValue Step { get; set; }
Property Value
Type | Description |
---|---|
TValue | Accepts the incremental or decremental step size value for the NumericTextBox. |
StrictMode
Specifies a value that indicates whether the NumericTextBox component allows the value for the specified range.
True - the input value will be restricted between the min and max range. The typed value gets modified to fit the range on a focused out state.
Else, it allows any value even out of range value, at that time of wrong value entered, the error class will be added to the component to highlight the error.
Declaration
public bool StrictMode { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
TabIndex
Specifies the tab order of the TextBox component.
Declaration
public int TabIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | An integer value representing the tab index of NumericTextBox component. |
ValidateDecimalOnType
Specifies whether the length of the decimal should be restricted during typing.
Declaration
public bool ValidateDecimalOnType { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Width
Specifies the width of the TextBox component.
Declaration
public string Width { get; set; }
Property Value
Type | Description |
---|---|
System.String | Accepts the string value. |
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |
ChangeHandler(ChangeEventArgs)
Declaration
protected override Task ChangeHandler(ChangeEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.ChangeEventArgs | args |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Overrides
DecrementAsync(TValue)
Decrements the NumericTextBox value with specified step value.
Declaration
public Task DecrementAsync(TValue step)
Parameters
Type | Name | Description |
---|---|---|
TValue | step | Specifies the value used to decrement the NumericTextBox value. If its not given then numeric value will be decremented based on the step property value. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
FocusAsync()
Sets the focus to the NumericTextBox component for interaction.
Declaration
public Task FocusAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
FocusHandler(FocusEventArgs)
Declaration
protected override Task FocusHandler(FocusEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Web.FocusEventArgs | args |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Overrides
FocusOutAsync()
Remove the focus from the NumericTextBox component, if the component is in focus state.
Declaration
public Task FocusOutAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
FocusOutHandler(FocusEventArgs)
Declaration
protected override Task FocusOutHandler(FocusEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Web.FocusEventArgs | args |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Overrides
FormatValue(String)
Declaration
protected override TValue FormatValue(string genericValue)
Parameters
Type | Name | Description |
---|---|---|
System.String | genericValue |
Returns
Type | Description |
---|---|
TValue |
Overrides
FormatValueAsString(TValue)
Declaration
protected override string FormatValueAsString(TValue formatValue)
Parameters
Type | Name | Description |
---|---|---|
TValue | formatValue |
Returns
Type | Description |
---|---|
System.String |
Overrides
GetFormattedText()
Returns the value of NumericTextBox with the format applied to the NumericTextBox.
Declaration
public string GetFormattedText()
Returns
Type | Description |
---|---|
System.String | The input element value. |
GetPersistDataAsync()
Gets the properties to be maintained in the persisted state.
Declaration
public Task<string> GetPersistDataAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | Task. |
IncrementAsync(TValue)
Increments the NumericTextBox value with the specified step value.
Specifies the value used to increment the NumericTextBox value.if its not given then numeric value will be incremented based on the step property value.Declaration
public Task IncrementAsync(TValue step)
Parameters
Type | Name | Description |
---|---|---|
TValue | step |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |