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.
Inheritance
System.Object
SfNumericTextBox<TValue>
Inherited Members
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BlurHandler()
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.OnChange
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.OnInput
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.OnPaste
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.OnBlur
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.OnFocus
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.ValueExpression
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.SpinButton
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.ValueTemplate
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.IsValueTemplate
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.ClickStopPropagation
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.MouseDowSpinnerPrevent
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.PreventIconHandler
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.MousePreventContainer
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.ContainerClass
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.RootClass
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
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BaseFloatLabelType
BaseHtmlAttributes
Declaration
protected override Dictionary<string, object> BaseHtmlAttributes { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.Dictionary<System.String, System.Object> |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BaseHtmlAttributes
BaseInputAttributes
Declaration
protected override Dictionary<string, object> BaseInputAttributes { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.Dictionary<System.String, System.Object> |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BaseInputAttributes
BaseIsReadOnlyInput
Declaration
protected override bool BaseIsReadOnlyInput { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BaseIsReadOnlyInput
BasePlaceholder
Declaration
protected override string BasePlaceholder { get; set; }
Property Value
Type |
Description |
System.String |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BasePlaceholder
BaseReadonly
Declaration
protected override bool BaseReadonly { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BaseReadonly
BaseShowClearButton
Declaration
protected override bool BaseShowClearButton { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BaseShowClearButton
BaseTabIndex
Declaration
protected override int BaseTabIndex { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BaseTabIndex
BaseWidth
Declaration
protected override string BaseWidth { get; set; }
Property Value
Type |
Description |
System.String |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.BaseWidth
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 |
|
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> |
|
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
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 |
|
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> |
|
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> |
|
Max
Specifies a maximum value that is allowed a user can enter.
Declaration
public TValue Max { get; set; }
Property Value
Min
Specifies a minimum value that is allowed a user can enter.
Declaration
public TValue Min { get; set; }
Property 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 |
|
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
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 |
|
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 |
|
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
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.ChangeHandler(Microsoft.AspNetCore.Components.ChangeEventArgs)
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
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
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.FocusHandler(Microsoft.AspNetCore.Components.Web.FocusEventArgs)
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
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.FocusOutHandler(Microsoft.AspNetCore.Components.Web.FocusEventArgs)
FormatValue(String)
Declaration
protected override TValue FormatValue(string genericValue)
Parameters
Type |
Name |
Description |
System.String |
genericValue |
|
Returns
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.FormatValue(System.String)
FormatValueAsString(TValue)
Declaration
protected override string FormatValueAsString(TValue formatValue)
Parameters
Type |
Name |
Description |
TValue |
formatValue |
|
Returns
Type |
Description |
System.String |
|
Overrides
Syncfusion.Blazor.Inputs.SfInputTextBase<TValue>.FormatValueAsString(TValue)
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.
|