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

Defines the fluent API for configuring the Kendo TextBox for ASP.NET MVC.

Definition

Constructors

Initializes a new instance of the TextBox class.

C#
public TextBoxBuilder(TextBox<T> component)
Parameters:componentTextBox<T>

The component.

Methods

If set to true, will render a button that can be used to clear the value.

C#
public TextBoxBuilder<T> ClearButton(bool value)
Parameters:valuebool

The value that configures the clearbutton.

Returns:

TextBoxBuilder<T>

Example:
C#
@( Html.Kendo().TextBox()
.Name("TextBox")
.ClearButton(true)
)

If set to false, the widget will be disabled and will not allow user input. The widget is enabled by default and allows user input.

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

The value that configures the enable.

Returns:

TextBoxBuilder<T>

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

Configures the client-side events.

C#
public TextBoxBuilder<T> Events(Action<TextBoxEventBuilder> configurator)
Parameters:configuratorAction<TextBoxEventBuilder>

The client events action.

Returns:

TextBoxBuilder<T>

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

Sets a value controlling how the color is applied.

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

The value that configures the fillmode.

Returns:

TextBoxBuilder<T>

Example:
C#
@( Html.Kendo().TextBox()
.Name("TextBox")
.FillMode(FillMode.Flat)
)

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 TextBoxBuilder<T> InputMode(string value)
Parameters:valuestring

The value that configures the "inputmode" attribute.

Returns:

TextBoxBuilder<T>

Example:
C#
@(Html.Kendo().TextBox()
.Name("textBox")
.InputMode("search")
)

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.

C#
public TextBoxBuilder<T> Label(Action<TextBoxLabelSettingsBuilder<T>> configurator)
Parameters:configuratorAction<TextBoxLabelSettingsBuilder<T>>

The action that configures the label.

Returns:

TextBoxBuilder<T>

Example:
C#
@( Html.Kendo().TextBox()
.Name("TextBox")
.Label(l =&gt; l.Content("TextBoxContent"))
)

The hint displayed by the widget when it is empty. Not set by default.

C#
public TextBoxBuilder<T> Placeholder(string value)
Parameters:valuestring

The value that configures the placeholder.

Returns:

TextBoxBuilder<T>

Example:
C#
@( Html.Kendo().TextBox()
.Name("TextBox")
.Placeholder("TextBoxPlaceholder")
)

The configuration for the prefix adornment of the widget.

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

The action that configures the prefix options.

Returns:

TextBoxBuilder<T>

If set to true, the widget will be readonly and will not allow user input. The widget is not readonly by default and allows user input.

C#
public TextBoxBuilder<T> Readonly(bool value)
Parameters:valuebool

The value that configures the readonly.

Returns:

TextBoxBuilder<T>

Example:
C#
@( Html.Kendo().TextBox()
.Name("TextBox")
.Readonly(true)
)

Sets a value controlling the border radius.

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

The value that configures the rounded.

Returns:

TextBoxBuilder<T>

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

Sets the size of the component.

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

The value that configures the size.

Returns:

TextBoxBuilder<T>

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

The configuration for the suffix adornment of the widget.

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

The action that configures the suffix options.

Returns:

TextBoxBuilder<T>

The value of the widget.

C#
public TextBoxBuilder<T> Value(string value)
Parameters:valuestring

The value that configures the value.

Returns:

TextBoxBuilder<T>

Example:
C#
@( Html.Kendo().TextBox()
.Name("TextBox")
.Value("TextBoxValue")
)