New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Kendo UI NumericTextBox component

Definition

Constructors

Initializes a new instance of the NumericTextBox<T> class.

C#
public NumericTextBox(ViewContext viewContext)
Parameters:viewContextViewContext

Properties

If this property is enabled and you have configured min and/or max values, and the user enters a value that falls out of that range, the value will automatically be set to either the minimum or maximum allowed value.

C#
public bool? AutoAdjust { get; set; }

Specifies the culture info used by the component. A valid kendo culture file must be added to the page in order for the example to work. <script src="https://cdn.jsdelivr.net/npm/@progress/kendo-ui@{version}/umd/cultures/kendo.culture.de-DE.min.js"&gt;&lt;/script>

C#
public string Culture { get; set; }

Specifies the number precision applied to the widget value and when the NumericTextBox is focused. If not set, the precision defined by the current culture is used. If the user enters a number with a greater precision than is currently configured, the widget value will be rounded. For example, if decimals is 2 and the user inputs 12.346, the value will become 12.35. If decimals is 1 the user inputs 12.99, the value will become 13.00.Compare with the format property.

C#
public int? Decimals { get; set; }

Specifies the text of the tooltip on the down arrow.

C#
public string DownArrowText { get; set; }

Enables or disables the textbox

C#
public bool? Enable { get; set; }

Specifies the factor by which the value is multiplied. The obtained result is used as edit value. So, if 15 as string is entered in the NumericTextBox and the factor value is set to 100 the visual value will be 1500. On blur the visual value will be divided by 100 thus scaling the widget value to the original proportion.

C#
public double? Factor { get; set; }

Sets a value controlling how the color is applied.

C#
public FillMode? FillMode { get; set; }

Specifies the number format used when the widget is not focused. Check this page for all valid number formats.Compare with the decimals property.

C#
public string Format { get; set; }

Specifies the inputmode attribute of the inner <input /> element. It is used to specify the type of on-screen keyboard that should be displayed when the user focuses the input.

C#
public string InputMode { get; set; }

Adds a label before the input. If the input has no id attribute, a generated id will be assigned. The string and the function parameters are setting the inner HTML of the label.

C#
public NumericTextBoxLabelSettings<T> Label { get; }

Max

T?

Specifies the largest value the user can enter.

C#
public T? Max { get; set; }

Min

T?

Specifies the smallest value the user can enter.

C#
public T? Min { get; set; }

The hint displayed by the widget when it is empty. Not set by default.

C#
public string Placeholder { get; set; }

The configuration for the prefix adornment of the component.

C#
public NumericTextBoxPrefixOptionsSettings<T> PrefixOptions { get; }

Specifies whether the decimals length should be restricted during typing. The length of the fraction is defined by the decimals value.

C#
public bool? RestrictDecimals { get; set; }

Specifies whether the value should be rounded or truncated. The length of the fraction is defined by the decimals value.

C#
public bool? Round { get; set; }

Sets a value controlling the border radius.

C#
public Rounded? Rounded { get; set; }

When set to true, the text of the input will be selected after the widget is focused.

C#
public bool? SelectOnFocus { get; set; }

Sets the size of the component.

C#
public ComponentSize? Size { get; set; }

Specifies whether the up and down spin buttons should be rendered

C#
public bool? Spinners { get; set; }

Specifies the value used to increment or decrement widget value.

C#
public T? Step { get; set; }

The configuration for the suffix adornment of the component.

C#
public NumericTextBoxSuffixOptionsSettings<T> SuffixOptions { get; }

Specifies the text of the tooltip on the up arrow.

C#
public string UpArrowText { get; set; }

Specifies the value of the NumericTextBox widget.

C#
public T? Value { get; set; }

Methods

GetElement method.

C#
protected override TagBuilder GetElement()
Returns:

TagBuilder

Overrides: WidgetBase.GetElement()

Serializes the component settings to a dictionary.

C#
public override IDictionary<string, object> Serialize()
Returns:

IDictionary<string, object>

A dictionary of settings.

Overrides: WidgetBase.Serialize()

Implements: IFormEditor.Serialize()

SerializeSettings method.

C#
protected override Dictionary<string, object> SerializeSettings()
Returns:

Dictionary<string, object>

Overrides: WidgetBase.SerializeSettings()

Writes the HTML content.

C#
protected override void WriteHtml(TextWriter writer)
Parameters:writerTextWriter

The text writer.

Overrides: WidgetBase.WriteHtml(TextWriter)

WriteInitializationScript method.

C#
public override void WriteInitializationScript(TextWriter writer)
Parameters:writerTextWriter

Overrides: WidgetBase.WriteInitializationScript(TextWriter)