NumericTextBoxBuilder
Methods
Value(System.Nullable)
Sets the initial value of the NumericTextBox.
Parameters
value - System.Nullable<T>
Step(Kendo.Mvc.UI.Fluent.T)
Parameters
step - T
Min(System.Nullable)
Sets the minimal possible value allowed to the user.
Parameters
min - System.Nullable<T>
Max(System.Nullable)
Sets the maximal possible value allowed to the user.
Parameters
max - System.Nullable<T>
Placeholder(System.String)
Sets the text which will be displayed if the textbox is empty.
Parameters
placeholder - System.String
RestrictDecimals(System.Boolean)
Enables or disables the restriction of the decimals length
Parameters
restrictDecimals - System.Boolean
Round(System.Boolean)
Enables or disables the rounding of the widget value
Parameters
round - System.Boolean
Spinners(System.Boolean)
Enables or disables the spin buttons.
Parameters
value - System.Boolean
Events(System.Action)
Configures the client-side events.
Parameters
EventsAction - System.Action<NumericTextBoxEventBuilder>
The client events action.
Example
@( Html.Kendo().NumericTextBox()
.Name("NumericTextBox")
.Events(events =>
events.OnLoad("onLoad").OnChange("onChange")
)
)
Enable(System.Boolean)
Enables or disables the textbox.
Parameters
value - System.Boolean
Size(Kendo.Mvc.UI.ComponentSize)
Sets the size of the component.
Parameters
value - ComponentSize
The value for Size
Rounded(Kendo.Mvc.UI.Rounded)
Sets a value controlling the border radius.
Parameters
value - Rounded
The value for Rounded
FillMode(Kendo.Mvc.UI.FillMode)
Sets a value controlling how the color is applied.
Parameters
value - FillMode
The value for FillMode
Factor(System.Double)
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.
Parameters
value - System.Double
The value for Factor
Format(System.String)
Stes the format of the NumericTextBox.
Parameters
format - System.String
Example
@( Html.Kendo().NumericTextBox()
.Name("NumericTextBox")
.Format("c3")
)
Label(System.Action)
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.
Parameters
configurator - System.Action<NumericTextBoxLabelSettingsBuilder>
The action that configures the label.
Example
@( Html.Kendo().NumericTextBox()
.Name("NumericTextBox")
.Label(l => l.Content("Age").Floating(true))
)
Culture(System.String)
Specifies the culture info used by the NumericTextBox widget.
Parameters
culture - System.String
Example
@( Html.Kendo().NumericTextBox()
.Name("NumericTextBox")
.Culture("de-DE")
)
Decimals(System.Int32)
Specifies the number precision. If not set precision defined by current culture is used.
Parameters
decimals - System.Int32
Example
@( Html.Kendo().NumericTextBox()
.Name("NumericTextBox")
.Decimals(3)
)
IncreaseButtonTitle(System.String)
Sets the title of the NumericTextBox increase button.
Parameters
title - System.String
DecreaseButtonTitle(System.String)
Sets the title of the NumericTextBox decrease button.
Parameters
title - System.String
SelectOnFocus(System.Boolean)
When set to true, the text of the input will be selected after the widget is focused.
Parameters
value - System.Boolean
The value for SelectOnFocus
SelectOnFocus()
When set to true, the text of the input will be selected after the widget is focused.
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 Kendo.Mvc.UI.Fluent.WidgetFactory.DeferredScripts(System.Boolean)
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>
AsChildComponent()
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();
)