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

EditorBuilder

The fluent API for configuring Kendo UI Editor for ASP.NET MVC.

Methods

Value(System.Action)

Sets the HTML content that will show initially in the editor.

Parameters

value - System.Action

The action which renders the HTML content.

Example


             @( Html.Kendo().Editor()
                       .Name("Editor")
                       .Value(() => { )
                           <blockquote>
                               According to Deep Thought, the answer to the ultimate question of
                               life, the universe and everything is <strong>42</strong>.
                           </blockquote>
                        @( })
                       .Render();
            )

Value(System.Func)

Sets the HTML content that will show initially in the editor.

Parameters

value - System.Func<Object,Object>

The predicate which renders the HTML content.

Example


             @( Html.Kendo().Editor()
                       .Name("Editor")
                       .Value(@<blockquote>
                               According to Deep Thought, the answer to the ultimate question of
                               life, the universe and everything is <strong>42</strong>.
                           </blockquote>)
                       .Render();
            )

Value(System.String)

Sets the HTML content which the item should display as a string.

Parameters

value - System.String

An HTML string.

Example


             @( Html.Kendo().Editor()
                        .Name("Editor")
                        .Value("<blockquote>A towel has <strong>immense</strong> psychological value</blockquote>")
            )

Events(System.Action)

Configure the client events.

Parameters

configurator - System.Action<EditorEventBuilder>

An action that configures the events.

Example


             @( Html.Kendo().Editor()
                        .Name("Editor")
                        .Events(events => events
                            .Change("onChange")
                        )
            )

Tools(System.Action)

Configure the available tools in the toolbar.

Parameters

configurator - System.Action<EditorToolFactory>

An action that configures the tools.

Example


             @( Html.Kendo().Editor()
                        .Name("Editor")
                        .Tools(tools => tools
                            .Clear()
                            .Bold()
                            .Italic()
                            .Underline()
                        )
            )

Tag(System.String)

Allow rendering of contentEditable elements instead of the default textarea editor. Note: contentEditable elements are not posted to the server.

Parameters

tagName - System.String

The tag that will be rendered as contentEditable

Example


             @( Html.Kendo().Editor()
                        .Name("Editor")
                        .Tag("div")
            )

Encode(System.Boolean)

Encode HTML content.

Parameters

value - System.Boolean

Example


             @( Html.Kendo().Editor()
                        .Name("Editor")
                        .Value("<blockquote>A towel has <strong>immense</strong> psychological value</blockquote>")
                        .Encode(true)
            )

Pdf(System.Action)

Parameters

configurator - System.Action<PDFSettingsBuilder>

StyleSheets(System.Action)

Sets the CSS files that will be registered in the Editor's iframe

Parameters

configurator - System.Action<EditorStyleSheetBuilder>

Example


             @( Html.Kendo().Editor()
                        .Name("Editor")
                        .StyleSheets(styleSheets => styleSheets.Add("editorStyles.css"))
            )

FileBrowser(System.Action)

Configure the file browser dialog.

Parameters

configurator - System.Action<EditorFileBrowserSettingsBuilder>

An action that configures the dialog.

Example


             @( Html.Kendo().Editor()
                        .Name("Editor")
                        .FileBrowser(fileBrowser => fileBrowser
                            .File("~/Content/UserFiles/{0}")
                            .Read("Read", "FileBrowser")
                            .Create("Create", "FileBrowser")
                            .Destroy("Destroy", "FileBrowser")
                            .Upload("Upload", "FileBrowser")
                        )
            )

ImageBrowser(System.Action)

Configure the image browser dialog.

Parameters

configurator - System.Action<EditorImageBrowserSettingsBuilder>

An action that configures the dialog.

Example


             @( Html.Kendo().Editor()
                        .Name("Editor")
                        .ImageBrowser(imageBrowser => imageBrowser
                            .Image("~/Content/UserFiles/Images/{0}")
                            .Read("Read", "ImageBrowser")
                            .Create("Create", "ImageBrowser")
                            .Destroy("Destroy", "ImageBrowser")
                            .Upload("Upload", "ImageBrowser")
                            .Thumbnail("Thumbnail", "ImageBrowser")
                        )
            )

ExportAs(System.Action)

Configure the exportAs settings.

Parameters

configurator - System.Action<EditorExportAsSettingsBuilder>

An action that configures the ExportAs settings.

Example


             @( Html.Kendo().Editor()
                        .Name("Editor")
                        .ExportAs(exportAs => exportAs
                            .FileName("Editor")
                            .Proxy("Export", "Editor")
                        )
            )

Import(System.Action)

Configure the import settings.

Parameters

configurator - System.Action<EditorImportSettingsBuilder>

An action that configures the Import settings.

Example


             @( Html.Kendo().Editor()
                        .Name("Editor")
                        .Import(import => import
                            .Proxy("Import", "Editor")
                        )
            )

Deserialization(System.Action)

Fine-tune deserialization in the Editor widget. Deserialization is the process of parsing the HTML string input from the value() method or from the viewHtml dialog into editable content.

Parameters

configurator - System.Action<EditorDeserializationSettingsBuilder>

The action that configures the deserialization.

Domain(System.String)

Relaxes the same-origin policy when using the iframe-based editor. This is done automatically for all cases except when the policy is relaxed by document.domain = document.domain. In that case, this property must be used to allow the editor to function properly across browsers. This property has been introduced in internal builds after 2014.1.319.

Parameters

value - System.String

The value that configures the domain.

Immutables()

If enabled, the editor disables the editing and command execution in elements marked with editablecontent="false" attribute.

Immutables(System.Boolean)

If enabled, the editor disables the editing and command execution in elements marked with editablecontent="false" attribute.

Parameters

enabled - System.Boolean

Enables or disables the immutables option.

Immutables(System.Action)

If enabled, the editor disables the editing and command execution in elements marked with editablecontent="false" attribute.

Parameters

configurator - System.Action<EditorImmutablesSettingsBuilder>

The action that configures the immutables.

Messages(System.Action)

Defines the text of the labels that are shown within the editor. Used primarily for localization.

Parameters

configurator - System.Action<EditorMessagesSettingsBuilder>

The action that configures the messages.

PasteCleanup(System.Action)

Options for controlling how the pasting content is modified before it is added in the editor.

Parameters

configurator - System.Action<EditorPasteCleanupSettingsBuilder>

The action that configures the pastecleanup.

Placeholder(System.String)

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

Parameters

value - System.String

The value that configures the placeholder.

Resizable()

If enabled, the editor renders a resize handle to allow users to resize it.

Resizable(System.Boolean)

If enabled, the editor renders a resize handle to allow users to resize it.

Parameters

enabled - System.Boolean

Enables or disables the resizable option.

Resizable(System.Action)

If enabled, the editor renders a resize handle to allow users to resize it.

Parameters

configurator - System.Action<EditorResizableSettingsBuilder>

The action that configures the resizable.

Serialization(System.Action)

Allows setting of serialization options.

Parameters

configurator - System.Action<EditorSerializationSettingsBuilder>

The action that configures the serialization.

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>

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?