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

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

Definition

Constructors

Initializes a new instance of the Form class.

C#
public FormBuilder(Form<T> component)
Parameters:componentForm<T>

The component.

Methods

Specifies the template which is used for rendering the Form buttons.

C#
public FormBuilder<T> ButtonsTemplate(string value)
Parameters:valuestring

The value that configures the buttonstemplate.

Returns:

FormBuilder<T>

Specifies the template which is used for rendering the Form buttons.

C#
public FormBuilder<T> ButtonsTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the buttonstemplate.

Returns:

FormBuilder<T>

Specifies the template which is used for rendering the Form buttons.

C#
public FormBuilder<T> ButtonsTemplateHandler(string value)
Parameters:valuestring

The value that configures the buttonstemplate.

Returns:

FormBuilder<T>

Specifies the template which is used for rendering the Form buttons.

C#
public FormBuilder<T> ButtonsTemplateId(string value)
Parameters:valuestring

The value that configures the buttonstemplate.

Returns:

FormBuilder<T>

Specifies the template which is used for rendering the Form buttons.

C#
public FormBuilder<T> ButtonsTemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the buttonstemplate.

Returns:

FormBuilder<T>

Specifies if the clearButton should be rendered on initialization.

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

The value that configures the clearbutton.

Returns:

FormBuilder<T>

Example:
C#
@(Html.Kendo().Form()
.Name("form")
.ClearButton(false)
)

Configures the client-side events.

C#
public FormBuilder<T> Events(Action<FormEventBuilder> configurator)
Parameters:configuratorAction<FormEventBuilder>

The client events action.

Returns:

FormBuilder<T>

Example:
C#
@( Html.Kendo().Form()
.Name("Form")
.Events(events =&gt; events
.Validate("onValidate")
)
)

Specifies if the first editor of the form will be focused on initialization.

C#
public FormBuilder<T> FocusFirst(bool value)
Parameters:valuebool

The value that configures the focusfirst.

Returns:

FormBuilder<T>

Callback function that could be used to change the default format of the automatically generated labels.

C#
public FormBuilder<T> FormatLabel(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The value that configures the formatlabel action.

Returns:

FormBuilder<T>

Example:
C#
@(Html.Kendo().Form&lt;Kendo.Mvc.Examples.Models.Form.FormItemsViewModels&gt;()
.Name("form")
.FormatLabel(@&lt;text&gt;
function(field){
return field + ":";
}
&lt;/text&gt;)
)

Callback function that could be used to change the default format of the automatically generated labels.

C#
public FormBuilder<T> FormatLabel(string handler)
Parameters:handlerstring

The value that configures the formatlabel action.

Returns:

FormBuilder<T>

Example:
C#
@(Html.Kendo().Form&lt;Kendo.Mvc.Examples.Models.Form.FormItemsViewModels&gt;()
.Name("form")
.FormatLabel("formatLabelHandler")
)
C#
public FormBuilder<T> FormData(object value)
Parameters:valueobjectReturns:

FormBuilder<T>

Grid layout settings.

C#
public FormBuilder<T> Grid(Action<FormGridSettingsBuilder<T>> configurator)
Parameters:configuratorAction<FormGridSettingsBuilder<T>>

The action that configures the grid.

Returns:

FormBuilder<T>

C#
public FormBuilder<T> Items(Action<FormItemFactory<T>> configurator)
Parameters:configuratorAction<FormItemFactory<T>>Returns:

FormBuilder<T>

Specify the layout of Form content. Valid options are: grid: This is equivalent to display: grid. It defines the form element as a grid container and establishes a new grid formatting context for its contents..

C#
public FormBuilder<T> Layout(string value)
Parameters:valuestring

The value that configures the layout.

Returns:

FormBuilder<T>

Configures text messages displayed in the Form. Use it to customize or localize the Form messages.

C#
public FormBuilder<T> Messages(Action<FormMessagesSettingsBuilder<T>> configurator)
Parameters:configuratorAction<FormMessagesSettingsBuilder<T>>

The action that configures the messages.

Returns:

FormBuilder<T>

Configures the Form orientation. Available options are "horizontal" and "vertical".By default, the Form is rendered with vertical orientation.

C#
public FormBuilder<T> Orientation(string value)
Parameters:valuestring

The value that configures the orientation.

Returns:

FormBuilder<T>

Sets a value controlling the size of the input.

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

The value that configures the size.

Returns:

FormBuilder<T>

C#
public FormBuilder<T> SmartPaste(Action<SmartPasteButtonBuilder> configurator)
Parameters:configuratorAction<SmartPasteButtonBuilder>Returns:

FormBuilder<T>

Configures the built-in Validator options.

C#
public FormBuilder<T> Validatable(Action<FormValidatableSettingsBuilder<T>> configurator)
Parameters:configuratorAction<FormValidatableSettingsBuilder<T>>

The action that configures the validatable.

Returns:

FormBuilder<T>