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

NumericTextBoxBuilder

Methods

Value(System.Nullable)

Sets the initial value of the NumericTextBox.

Parameters

value - System.Nullable<T>

The value that configures the initial value.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .Value(10)
            )

Step(Kendo.Mvc.UI.Fluent.T)

Parameters

step - T

Min(System.Nullable)

Specifies the smallest value the user can enter.

Parameters

min - System.Nullable<T>

The value that configures the minimum possible value.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .Min(1)
            )

Max(System.Nullable)

Specifies the maximum value the user can enter.

Parameters

max - System.Nullable<T>

The value that configures the maximum possible value.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .Max(100)
            )

Placeholder(System.String)

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

Parameters

placeholder - System.String

The value that configures the maximum possible value.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .Placeholder("Enter age...")
            )

RestrictDecimals(System.Boolean)

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

Parameters

restrictDecimals - System.Boolean

The value that enables or disables the option.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .Decimals(3)
                .RestrictDecimals(true)
            )

Round(System.Boolean)

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

Parameters

round - System.Boolean

The value that enables or disables the option.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .Decimals(3)
                .Round(true)
            )

Spinners(System.Boolean)

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

Parameters

value - System.Boolean

The value that shows or hides the spin buttons.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .Spinners(false)
            )

Events(System.Action)

Configures the handled client-side events of the NumericTextBox.

Parameters

EventsAction - System.Action<NumericTextBoxEventBuilder>

The action that configures the available events.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .Events(events => events.Change("onChange"))
            )

Enable(System.Boolean)

Enables or disables the NumericTextBox.

Parameters

value - System.Boolean

The value that enables or disables the component.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .Enable(false)
            )

Size(Kendo.Mvc.UI.ComponentSize)

Sets a value that controls the size of the component.

Parameters

value - ComponentSize

The enum value that configures the size.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .Size(ComponentSize.Medium)
            )

Rounded(Kendo.Mvc.UI.Rounded)

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

Parameters

value - Rounded

The enum value that configures the border radius.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .Rounded(Rounded.Medium)
            )

FillMode(Kendo.Mvc.UI.FillMode)

Sets a value that controls how the color is applied.

Parameters

value - FillMode

The enum value that configures the fill mode.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .FillMode(FillMode.Solid)
            )

Factor(System.Double)

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.

Parameters

value - System.Double

The value that configures the factor.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .Factor(100)
            )

Format(System.String)

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

Parameters

format - System.String

The value that configures the format.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .Format("c3")
            )

Label(System.Action)

Adds a label before the input.

Parameters

configurator - System.Action<NumericTextBoxLabelSettingsBuilder>

The action that configures the label settings.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .Label(l => l.Content("Age").Floating(true))
            )

Culture(System.String)

Specifies the culture info used by the NumericTextBox.

Parameters

culture - System.String

The value that configures the culture.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .Culture("de-DE")
            )

Decimals(System.Int32)

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.

Parameters

decimals - System.Int32

The value that configures the number precision.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .Decimals(3)
            )

IncreaseButtonTitle(System.String)

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

Parameters

title - System.String

The value that configures the title.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .IncreaseButtonTitle("Up")
            )

DecreaseButtonTitle(System.String)

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

Parameters

title - System.String

The value that configures the title.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .DecreaseButtonTitle("Down")
            )

SelectOnFocus(System.Boolean)

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

Parameters

value - System.Boolean

The value that enables or disables the option.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .SelectOnFocus(true)
            )

SelectOnFocus()

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

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .SelectOnFocus(true)
            )

PrefixOptions(System.Action)

Defines the configuration for the prefix adornment of the component.

Parameters

configurator - System.Action<PrefixOptionsSettingsBuilder>

The action that configures the prefix options.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .PrefixOptions(prefix => prefix.Icon("info-circle"))
            )

SuffixOptions(System.Action)

Defines the configuration for the suffix adornment of the component.

Parameters

configurator - System.Action<SuffixOptionsSettingsBuilder>

The action that configures the suffix options.

Example


            @(Html.Kendo().NumericTextBox()
                .Name("numericTextBox")
                .SuffixOptions(suffix => suffix.Separator(false).Template("<div class='selected-length-unit'>mm</div>"))
            )

AutoAdjust(System.Boolean)

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.

Parameters

value - System.Boolean

The value that enables or disables the option

Example


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

ToComponent()

Returns the internal view component.

Name(System.String)

Sets the name of the component.

Parameters

componentName - System.String

The name of the component.

Example


            @(Html.Kendo().Grid<OrderViewModel>()
               .Name("grid")
               .Columns(columns =>
               {
                   columns.Bound(p => p.OrderID).Filterable(false);
                   columns.Bound(p => p.Freight);
               })
               .DataSource(dataSource => dataSource
                   .Ajax()
                   .PageSize(20)
                   .Read(read => read.Action("Orders_Read", "Grid"))
               )
            )

Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with

Parameters

deferred - System.Boolean

ModelMetadata(System.Web.Mvc.ModelMetadata)

Uses the Metadata of the Model.

Parameters

modelMetadata - System.Web.Mvc.ModelMetadata

The metadata set for the Model

HtmlAttributes(System.Object)

Sets the HTML attributes.

Parameters

attributes - System.Object

The HTML attributes.

HtmlAttributes(System.Collections.Generic.IDictionary)

Parameters

attributes - System.Collections.Generic.IDictionary<String,Object>

AsModule(System.Boolean)

Specifies whether the initialization script of the component will be rendered as a JavaScript module.

Parameters

value - System.Boolean

Render()

Renders the component.

Example


            @(@Page Inherits="System.Web.Mvc.ViewPage<IEnumerable<Product>>" )
            @( Html.Kendo().Grid(Model)
                .Name("grid")
                .DetailTemplate(product => {
                    )
                       Product Details:
                       <div>Product Name: @( product.ProductName )</div>
                       <div>Units In Stock: @( product.UnitsInStock )</div>
                    @(
                })
                .Render();
            )

ScriptAttributes(System.Object,System.Boolean)

Sets the JavaScript attributes to the initialization script.

Parameters

attributes - System.Object

The JavaScript attributes.

overrideAttributes - System.Boolean

Argument which determines whether attributes should be overriden.

ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)

Sets the JavaScript attributes to the initialization script.

Parameters

attributes - System.Collections.Generic.IDictionary<String,Object>

The JavaScript attributes.

overrideAttributes - System.Boolean

Argument which determines whether attributes should be overriden.

ToHtmlString()

ToClientTemplate()

In this article
Not finding the help you need?