MaskedTextBoxBuilder
Methods
Value(System.String)
Sets the initial value of the MaskedTextBox.
Parameters
value - System.String
UnmaskOnPost(System.Boolean)
Specifies whether the widget will unmask input value on form post
Parameters
value - System.Boolean
ClearPromptChar(System.Boolean)
Specifies whether the widget will replace the prompt characters with spaces on blur
Parameters
value - System.Boolean
PromptChar(System.String)
Specifies the character used to represent the absence of user input in the widget
Parameters
promptChar - System.String
Events(System.Action)
Configures the client-side events.
Parameters
EventsAction - System.Action<MaskedTextBoxEventBuilder>
The client events action.
Example
@( Html.Kendo().MaskedTextBox()
.Name("MaskedTextBox")
.Events(events =>
events.Change("change")
)
)
Rules(System.Action)
Configures the custom rules.
Parameters
RulesAction - System.Action<MaskedTextBoxRulesBuilder>
The rules action.
Example
@( Html.Kendo().MaskedTextBox()
.Name("MaskedTextBox")
.Rules(rules =>
rules.Add("~", "/[+-]/")
)
)
Enable(System.Boolean)
Enables or disables the textbox.
Parameters
value - System.Boolean
Mask(System.String)
Sets the mask of the MaskedTextBox.
Parameters
mask - System.String
Example
@( Html.Kendo().MaskedTextBox()
.Name("MaskedTextBox")
.Mask("999 000 000")
)
Culture(System.String)
Specifies the culture info used by the MaskedTextBox widget.
Parameters
culture - System.String
Example
@( Html.Kendo().MaskedTextBox()
.Name("MaskedTextBox")
.Culture("de-DE")
)
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<MaskedTextBoxLabelSettingsBuilder>
The action that configures the label.
Example
@( Html.Kendo().MaskedTextBox()
.Name("MaskedTextBox")
.Label(l => l.Content("Phone number").Floating(true))
)
FillMode(Kendo.Mvc.UI.FillMode)
Sets a value controlling how the color is applied. Can also be set to the following string values: null; "solid"; "flat" or "outline"..
Parameters
value - FillMode
The value for FillMode
Example
@( Html.Kendo().MaskedTextBox()
.Name("MaskedTextBox")
.FillMode("solid")
)
Rounded(Kendo.Mvc.UI.Rounded)
Parameters
value - Rounded
Size(Kendo.Mvc.UI.ComponentSize)
Sets a value controlling size of the component. Can also be set to the following string values: "small"; "medium"; "large" or null.
Parameters
value - ComponentSize
The value for Size
Example
@( Html.Kendo().MaskedTextBox()
.Name("MaskedTextBox")
.Size("medium")
)
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();
)