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

Defines the fluent interface for configuring the NumericTextBox<T> component.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

T

Syntax:

C#
public class NumericTextBoxBuilder<T> : WidgetBuilderBase<NumericTextBox<T>, NumericTextBoxBuilder<T>>, IHtmlString where T : struct

Inheritance: objectWidgetBuilderBase<NumericTextBox<T>, NumericTextBoxBuilder<T>>NumericTextBoxBuilder<T>

Implements: IHtmlString

Inherited Members WidgetBuilderBase<NumericTextBox<T>, NumericTextBoxBuilder<T>>.ToComponent()WidgetBuilderBase<NumericTextBox<T>, NumericTextBoxBuilder<T>>.Name(string)WidgetBuilderBase<NumericTextBox<T>, NumericTextBoxBuilder<T>>.Deferred(bool)WidgetBuilderBase<NumericTextBox<T>, NumericTextBoxBuilder<T>>.ModelMetadata(ModelMetadata)WidgetBuilderBase<NumericTextBox<T>, NumericTextBoxBuilder<T>>.HtmlAttributes(object)WidgetBuilderBase<NumericTextBox<T>, NumericTextBoxBuilder<T>>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<NumericTextBox<T>, NumericTextBoxBuilder<T>>.AsModule(bool)WidgetBuilderBase<NumericTextBox<T>, NumericTextBoxBuilder<T>>.Render()WidgetBuilderBase<NumericTextBox<T>, NumericTextBoxBuilder<T>>.ScriptAttributes(object, bool)WidgetBuilderBase<NumericTextBox<T>, NumericTextBoxBuilder<T>>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<NumericTextBox<T>, NumericTextBoxBuilder<T>>.ToHtmlString()WidgetBuilderBase<NumericTextBox<T>, NumericTextBoxBuilder<T>>.ToClientTemplate()WidgetBuilderBase<NumericTextBox<T>, NumericTextBoxBuilder<T>>.ToString()WidgetBuilderBase<NumericTextBox<T>, NumericTextBoxBuilder<T>>.Componentobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

C#
public NumericTextBoxBuilder(NumericTextBox<T> component)
Parameters:componentNumericTextBox<T>

Methods

If the option is enabled, the Min() and Max() options are defined, 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 NumericTextBoxBuilder<T> AutoAdjust(bool value)
Parameters:valuebool

The value that enables or disables the option

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.AutoAdjust(true)
.Min(10)
.Max(20)
)

Specifies the culture info used by the NumericTextBox.

C#
public NumericTextBoxBuilder<T> Culture(string culture)
Parameters:culturestring

The value that configures the culture.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.Culture("de-DE")
)

Specifies the number precision applied to the component's value when the NumericTextBox is focused. If the option is not set, the precision is defined by the current culture. If the user enters a number with a greater precision than the currently configured precision, the component's value will be rounded. For example, if Decimals(2) and the user inputs 12.346, the value will become 12.35. If Decimals(2) and the user inputs 12.99, the value will become 13.00.

C#
public NumericTextBoxBuilder<T> Decimals(int decimals)
Parameters:decimalsint

The value that configures the number precision.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.Decimals(3)
)

Specifies the title of the NumericTextBox decrease button. The default title on hover is "Decrease value".

C#
public NumericTextBoxBuilder<T> DecreaseButtonTitle(string title)
Parameters:titlestring

The value that configures the title.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.DecreaseButtonTitle("Down")
)

Enables or disables the NumericTextBox.

C#
public NumericTextBoxBuilder<T> Enable(bool value)
Parameters:valuebool

The value that enables or disables the component.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.Enable(false)
)

Configures the handled client-side events of the NumericTextBox.

C#
public NumericTextBoxBuilder<T> Events(Action<NumericTextBoxEventBuilder> EventsAction)
Parameters:EventsActionAction<NumericTextBoxEventBuilder>

The action that configures the available events.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.Events(events =&gt; events.Change("onChange"))
)

Specifies the factor by which the value is multiplied. The obtained result is used as an edit value. For example, if "15" 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 component's value to the original proportion.

C#
public NumericTextBoxBuilder<T> Factor(double value)
Parameters:valuedouble

The value that configures the factor.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.Factor(100)
)

Sets a value that controls how the color is applied.

C#
public NumericTextBoxBuilder<T> FillMode(FillMode value)
Parameters:valueFillMode

The enum value that configures the fill mode.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.FillMode(FillMode.Solid)
)

Specifies the number format used when the NumericTextBox is not focused.

C#
public NumericTextBoxBuilder<T> Format(string format)
Parameters:formatstring

The value that configures the format.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.Format("c3")
)

Specifies the title of the NumericTextBox increase button. The default title on hover is "Increase value".

C#
public NumericTextBoxBuilder<T> IncreaseButtonTitle(string title)
Parameters:titlestring

The value that configures the title.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.IncreaseButtonTitle("Up")
)

Defines the "inputmode" attribute of the inner <input /> element. The attribute specifies the type of on-screen keyboard displayed when the user focuses the input.

C#
public NumericTextBoxBuilder<T> InputMode(string value)
Parameters:valuestring

The value that configures the "inputmode" attribute.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.InputMode("numeric")
)

Adds a label before the input.

C#
public NumericTextBoxBuilder<T> Label(Action<NumericTextBoxLabelSettingsBuilder> configurator)
Parameters:configuratorAction<NumericTextBoxLabelSettingsBuilder>

The action that configures the label settings.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.Label(l =&gt; l.Content("Age").Floating(true))
)

Specifies the maximum value the user can enter.

C#
public NumericTextBoxBuilder<T> Max(T? max)
Parameters:maxT?

The value that configures the maximum possible value.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.Max(100)
)

Specifies the smallest value the user can enter.

C#
public NumericTextBoxBuilder<T> Min(T? min)
Parameters:minT?

The value that configures the minimum possible value.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.Min(1)
)

Sets the text that will be displayed when the NumericTextBox is empty.

C#
public NumericTextBoxBuilder<T> Placeholder(string placeholder)
Parameters:placeholderstring

The value that configures the maximum possible value.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.Placeholder("Enter age...")
)

Defines the configuration for the prefix adornment of the component.

C#
public NumericTextBoxBuilder<T> PrefixOptions(Action<PrefixOptionsSettingsBuilder> configurator)
Parameters:configuratorAction<PrefixOptionsSettingsBuilder>

The action that configures the prefix options.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.PrefixOptions(prefix =&gt; prefix.Icon("info-circle"))
)

Specifies whether the decimals length must be restricted during typing. The length of the fraction is defined by the Decimals() value.

C#
public NumericTextBoxBuilder<T> RestrictDecimals(bool restrictDecimals)
Parameters:restrictDecimalsbool

The value that enables or disables the option.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.Decimals(3)
.RestrictDecimals(true)
)

Specifies whether the value must be rounded or truncated. The length of the fraction is defined by the Decimals() value.

C#
public NumericTextBoxBuilder<T> Round(bool round)
Parameters:roundbool

The value that enables or disables the option.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.Decimals(3)
.Round(true)
)

Sets a value that controls the border radius of the component.

C#
public NumericTextBoxBuilder<T> Rounded(Rounded? value)
Parameters:valueRounded?

The enum value that configures the border radius.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.Rounded(Rounded.Medium)
)

Controls whether the value of the input must be selected after the component is focused.

C#
public NumericTextBoxBuilder<T> SelectOnFocus()
Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.SelectOnFocus()
)

Controls whether the value of the input must be selected after the component is focused.

C#
public NumericTextBoxBuilder<T> SelectOnFocus(bool value)
Parameters:valuebool

The value that enables or disables the option.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.SelectOnFocus(true)
)

Sets a value that controls the size of the component.

C#
public NumericTextBoxBuilder<T> Size(ComponentSize? value)
Parameters:valueComponentSize?

The enum value that configures the size.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.Size(ComponentSize.Medium)
)

Specifies whether the up and down spin buttons must be rendered.

C#
public NumericTextBoxBuilder<T> Spinners(bool value)
Parameters:valuebool

The value that shows or hides the spin buttons.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.Spinners(false)
)

Specifies the value used to increment or decrement NumericTextBox value.

C#
public NumericTextBoxBuilder<T> Step(T step)
Parameters:stepT

The value that configures the step.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.Step(2)
)

Defines the configuration for the suffix adornment of the component.

C#
public NumericTextBoxBuilder<T> SuffixOptions(Action<SuffixOptionsSettingsBuilder> configurator)
Parameters:configuratorAction<SuffixOptionsSettingsBuilder>

The action that configures the suffix options.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.SuffixOptions(suffix =&gt; suffix.Separator(false).Template("&lt;div class='selected-length-unit'&gt;mm&lt;/div&gt;"))
)

Sets the initial value of the NumericTextBox.

C#
public NumericTextBoxBuilder<T> Value(T? value)
Parameters:valueT?

The value that configures the initial value.

Returns:

NumericTextBoxBuilder<T>

Example:
C#
@(Html.Kendo().NumericTextBox()
.Name("numericTextBox")
.Value(10)
)