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

FormBuilder

Methods

ButtonsTemplate(System.String)

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

Parameters

value - System.String

The value that configures the buttonstemplate.

ButtonsTemplateId(System.String)

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

Parameters

value - System.String

The value that configures the buttonstemplate.

ButtonsTemplateView(System.Web.Mvc.MvcHtmlString)

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

Parameters

value - System.Web.Mvc.MvcHtmlString

The value that configures the buttonstemplate.

ButtonsTemplateHandler(System.String)

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

Parameters

value - System.String

The value that configures the buttonstemplate.

ButtonsTemplate(Kendo.Mvc.UI.TemplateBuilder)

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

Parameters

template - TemplateBuilder<TModel>

A Template component that configures the buttonstemplate.

FocusFirst(System.Boolean)

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

Parameters

value - System.Boolean

The value that configures the focusfirst.

FormatLabel(System.Func)

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

Parameters

handler - System.Func<Object,Object>

The value that configures the formatlabel action.

Example


            @(Html.Kendo().Form<Kendo.Mvc.Examples.Models.Form.FormItemsViewModels>()
                      .Name("form")
                      .FormatLabel(@<text>
                            function(field){
                                return field + ":";
                            }
                      </text>)
            )

FormatLabel(System.String)

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

Parameters

handler - System.String

The value that configures the formatlabel action.

Example


            @(Html.Kendo().Form<Kendo.Mvc.Examples.Models.Form.FormItemsViewModels>()
                      .Name("form")
                      .FormatLabel("formatLabelHandler")
            )

Orientation(System.String)

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

Parameters

value - System.String

The value that configures the orientation.

Messages(System.Action)

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

Parameters

configurator - System.Action<FormMessagesSettingsBuilder>

The action that configures the messages.

Layout(System.String)

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..

Parameters

value - System.String

The value that configures the layout.

Grid(System.Action)

Grid layout settings.

Parameters

configurator - System.Action<FormGridSettingsBuilder>

The action that configures the grid.

Validatable(System.Action)

Configures the built-in Validator options.

Parameters

configurator - System.Action<FormValidatableSettingsBuilder>

The action that configures the validatable.

Items(System.Action)

Parameters

configurator - System.Action<FormItemFactory>

FormData(System.Object)

Parameters

value - System.Object

Events(System.Action)

Configures the client-side events.

Parameters

configurator - System.Action<FormEventBuilder>

The client events action.

Example


             @( Html.Kendo().Form()
                        .Name("Form")
                        .Events(events => events
                            .Validate("onValidate")
                        )
            )

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();
            )

ToHtmlString()

ToClientTemplate()

In this article
Not finding the help you need?