Kendo UI NumericTextBox TagHelper NumericTextBoxTagHelper class.
Definition
Namespace:Kendo.Mvc.TagHelpers
Assembly:Kendo.Mvc.dll
Syntax:
[HtmlTargetElement("kendo-numerictextbox", TagStructure = TagStructure.NormalOrSelfClosing)]
[HtmlTargetElement("numerictextbox-editor", ParentTag = "form-item")]
[HtmlTargetElement("numerictextbox-editor", ParentTag = "property-grid-item")]
[RestrictChildren("numerictextbox-label", new string[] { "prefix-options", "suffix-options" })]
public class NumericTextBoxTagHelper : TagHelperBase, ITagHelper, ITagHelperComponent, IKendoFormEditor
Inheritance: objectTagHelperTagHelperBaseNumericTextBoxTagHelper
Implements:
Inherited Members
Example:
@addTagHelper *, Kendo.Mvc
<kendo-numerictextbox name="numerictextbox" auto-adjust="true" />
Child Tags
Constructors
Initializes a new instance of the NumericTextBoxTagHelper class.
public NumericTextBoxTagHelper(IKendoHtmlGenerator generator)
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.
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://kendo.cdn.telerik.com/{kendo version}/js/cultures/kendo.culture.de-DE.min.js"></script>
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.
public int? Decimals { get; set; }
Specifies the text of the tooltip on the down arrow.
public string DownArrowText { 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.
public double? Factor { get; set; }
Sets a value controlling how the color is applied.
public FillMode? FillMode { get; set; }
An expression to be evaluated against the current model.
public ModelExpression For { 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.
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.
public string InputMode { get; set; }
IsNested member.
[HtmlAttributeNotBound]
public bool IsNested { get; set; }
Implements:
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.
[HtmlAttributeName("label")]
public string LabelValue { get; set; }
The name of the JavaScript function that will handle the change event. Fires when the value is changed
public string OnChange { get; set; }
The name of the JavaScript function that will handle the kendoKeydown event. Triggered when the user presses a keyboard key while the NumericTextBox is focused.The event handler function context (available via the this keyword) will be set to the widget instance.
public string OnKendoKeydown { get; set; }
The name of the JavaScript function that will handle the spin event. Fires when the value is changed from the spin buttons
public string OnSpin { get; set; }
The hint displayed by the widget when it is empty. Not set by default.
public string Placeholder { get; set; }
Specifies whether the decimals length should be restricted during typing. The length of the fraction is defined by the decimals value.
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.
public bool? Round { get; set; }
When set to true, the text of the input will be selected after the widget is focused.
public bool? SelectOnFocus { get; set; }
Sets the size of the component.
public ComponentSize? Size { get; set; }
Specifies whether the up and down spin buttons should be rendered
public bool? Spinners { get; set; }
Specifies the value used to increment or decrement widget value.
public double? Step { get; set; }
Specifies the text of the tooltip on the up arrow.
public string UpArrowText { get; set; }
Methods
Gets the initialization script.
protected override string GetInitializationScript()
The initialization script.
Overrides:
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Overrides:
Serializes the defined settings.
public override IDictionary<string, object> Serialize()
Overrides:
SerializeEvents method.
protected override Dictionary<string, object> SerializeEvents()
Overrides:
SerializeSettings method.
protected override Dictionary<string, object> SerializeSettings()
Overrides:
TryAddAsEditor method.
public bool TryAddAsEditor(TagHelperContext context)
The result.
Implements:
Writes the HTML output.
protected override void WriteHtml(TagHelperOutput output)
The TagHelper output.
Overrides: