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

The fluent API for configuring the Telerik UI for ASP.NET MVC Editor.

Definition

Constructors

C#
public EditorBuilder(Editor component)
Parameters:componentEditor

Methods

Defines the configuration options for the AI tools in the Editor.

C#
public EditorBuilder AI(Action<EditorAISettingsBuilder> configurator)
Parameters:configuratorAction<EditorAISettingsBuilder>

The configurator for the ai setting.

Returns:

EditorBuilder

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

C#
public EditorBuilder Deserialization(Action<EditorDeserializationSettingsBuilder> configurator)
Parameters:configuratorAction<EditorDeserializationSettingsBuilder>

The action that configures the deserialization.

Returns:

EditorBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.Deserialization(d =&gt; d.Custom("htmlDeserialization"))
)
&lt;script&gt;
function htmlDeserialization(html) {
return html.replace(/(&lt;\/?)b(\s?)/, "$1strong$2");
}
&lt;/script&gt;

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.

C#
public EditorBuilder Domain(string value)
Parameters:valuestring

The value that configures the domain.

Returns:

EditorBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.Domain("example.com")
)

Encodes the HTML content. By default, the submitted value is encoded.

C#
public EditorBuilder Encode(bool value)
Parameters:valueboolReturns:

EditorBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.Value("&lt;blockquote&gt;A towel has &lt;strong&gt;immense&lt;/strong&gt; psychological value&lt;/blockquote&gt;")
.Encode(true)
)

Configures the client events.

C#
public EditorBuilder Events(Action<EditorEventBuilder> configurator)
Parameters:configuratorAction<EditorEventBuilder>

The action that configures the client events.

Returns:

EditorBuilder

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

Configures the export settings.

C#
public EditorBuilder ExportAs(Action<EditorExportAsSettingsBuilder> configurator)
Parameters:configuratorAction<EditorExportAsSettingsBuilder>

The action that configures the ExportAs settings.

Returns:

EditorBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.ExportAs(exportAs =&gt; exportAs
.FileName("Editor")
.Proxy("Export", "Editor")
)
)

Configures the file browser dialog.

C#
public EditorBuilder FileBrowser(Action<EditorFileBrowserSettingsBuilder> configurator)
Parameters:configuratorAction<EditorFileBrowserSettingsBuilder>

The action that configures the file browser dialog.

Returns:

EditorBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.FileBrowser(fileBrowser =&gt; fileBrowser
.File("~/Content/UserFiles/{0}")
.Read("Read", "FileBrowser")
.Create("Create", "FileBrowser")
.Destroy("Destroy", "FileBrowser")
.Upload("Upload", "FileBrowser")
)
)

The delay in milliseconds before the formatting marks are refreshed. This feature is useful for performance optimization as the formatting marks are re-rendered any time the user presses a key. If the user is typing very fast or holding down a key, the delay will prevent the re-rendering from being executed multiple times.The visual effect from this configuration is that the marks will briefly disappear while the user is typing. You can set the value to false to fully turn off this behavior.

C#
public EditorBuilder FormattingMarksRefreshDelay(bool value)
Parameters:valuebool

The value that configures the formattingmarksrefreshdelay.

Returns:

EditorBuilder

The delay in milliseconds before the formatting marks are refreshed. This feature is useful for performance optimization as the formatting marks are re-rendered any time the user presses a key. If the user is typing very fast or holding down a key, the delay will prevent the re-rendering from being executed multiple times.The visual effect from this configuration is that the marks will briefly disappear while the user is typing. You can set the value to false to fully turn off this behavior.

C#
public EditorBuilder FormattingMarksRefreshDelay(double value)
Parameters:valuedouble

The value that configures the formattingmarksrefreshdelay.

Returns:

EditorBuilder

Configures the image browser dialog.

C#
public EditorBuilder ImageBrowser(Action<EditorImageBrowserSettingsBuilder> configurator)
Parameters:configuratorAction<EditorImageBrowserSettingsBuilder>

The action that configures the image browser dialog.

Returns:

EditorBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.ImageBrowser(imageBrowser =&gt; imageBrowser
.Image("~/Content/UserFiles/Images/{0}")
.Read("Read", "ImageBrowser")
.Create("Create", "ImageBrowser")
.Destroy("Destroy", "ImageBrowser")
.Upload("Upload", "ImageBrowser")
.Thumbnail("Thumbnail", "ImageBrowser")
)
)

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

C#
public EditorBuilder Immutables()
Returns:

EditorBuilder

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

C#
public EditorBuilder Immutables(Action<EditorImmutablesSettingsBuilder> configurator)
Parameters:configuratorAction<EditorImmutablesSettingsBuilder>

The action that configures the immutables.

Returns:

EditorBuilder

Example:
C#
@(Html.Kendo().Editor()
.Name("Editor")
.Immutables(immutables =&gt; {
immutables.SerializationHandler("immutablesSerialization");
immutables.Deserialization("immutablesDeserialization");
})
)

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

C#
public EditorBuilder Immutables(bool enabled)
Parameters:enabledbool

Enables or disables the immutables option.

Returns:

EditorBuilder

Example:
C#
@(Html.Kendo().Editor()
.Name("Editor")
.Immutables(false)
)

Configures the import settings.

C#
public EditorBuilder Import(Action<EditorImportSettingsBuilder> configurator)
Parameters:configuratorAction<EditorImportSettingsBuilder>

The action that configures the Import settings.

Returns:

EditorBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.Import(import =&gt; import
.Proxy("Import", "Editor")
)
)

This property enables you to configure height for the Editor when the component is in inline mode.

C#
public EditorBuilder InlineHeight(double value)
Parameters:valuedouble

The value that configures the inlineheight.

Returns:

EditorBuilder

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

C#
public EditorBuilder Messages(Action<EditorMessagesSettingsBuilder> configurator)
Parameters:configuratorAction<EditorMessagesSettingsBuilder>

The action that configures the messages.

Returns:

EditorBuilder

Example:
C#
@(Html.Kendo().Editor()
.Name("Editor")
.Messages(messages =&gt; messages.CreateTable("New Table"))
)

If set to true this configuration option would enable Tab-based navigation among Editor ToolBar items. By default navigation is arrow-based.

C#
public EditorBuilder NavigateOnTab(bool value)
Parameters:valuebool

The value that configures the navigateontab.

Returns:

EditorBuilder

When strict CSP is enabled a nonce can be provided for the inline styles. The passed value would be used as the nonce attribute for the inline styles in the content area iframe, the placeholder inline style and the link tags loading external stylesheets in the content area.

C#
public EditorBuilder Nonce(string value)
Parameters:valuestring

The value that configures the nonce.

Returns:

EditorBuilder

When pasting a block element inside an element such as a list ul, the list gets split in half and the block element is inserted between the two ul elements.This configuration enables you to specify elements for which the above behavior will be ignored.

C#
public EditorBuilder NonSplittableTagsOnPaste(Action<EditorNonSplittableTagsOnPasteFactory> configurator)
Parameters:configuratorAction<EditorNonSplittableTagsOnPasteFactory>

The action that configures the nonsplittabletagsonpaste.

Returns:

EditorBuilder

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

C#
public EditorBuilder PasteCleanup(Action<EditorPasteCleanupSettingsBuilder> configurator)
Parameters:configuratorAction<EditorPasteCleanupSettingsBuilder>

The action that configures the pastecleanup.

Returns:

EditorBuilder

Configures the PDF export settings.

C#
public EditorBuilder Pdf(Action<PDFSettingsBuilder> configurator)
Parameters:configuratorAction<PDFSettingsBuilder>

The action that configures the PDF settings.

Returns:

EditorBuilder

Example:
C#
@(Html.Kendo().Editor()
.Name("Editor")
.Pdf(pdf =&gt; pdf
.Margin(20, 20, 20, 20)
.PaperSize("A4")
.ProxyURL(Url.Action("Pdf_Export_Save", "Editor"))
)
)

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

C#
public EditorBuilder Placeholder(string value)
Parameters:valuestring

The value that configures the placeholder.

Returns:

EditorBuilder

Example:
C#
@(Html.Kendo().Editor()
.Name("Editor")
.Placeholder("Enter some text")
)

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

C#
public EditorBuilder Resizable()
Returns:

EditorBuilder

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

C#
public EditorBuilder Resizable(Action<EditorResizableSettingsBuilder> configurator)
Parameters:configuratorAction<EditorResizableSettingsBuilder>

The action that configures the resizable.

Returns:

EditorBuilder

Example:
C#
@(Html.Kendo().Editor()
.Name("Editor")
.Resizable(resize =&gt; resize.Content(true))
)

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

C#
public EditorBuilder Resizable(bool enabled)
Parameters:enabledbool

Enables or disables the resizable option.

Returns:

EditorBuilder

Example:
C#
@(Html.Kendo().Editor()
.Name("Editor")
.Resizable(true)
)

Allows setting of serialization options.

C#
public EditorBuilder Serialization(Action<EditorSerializationSettingsBuilder> configurator)
Parameters:configuratorAction<EditorSerializationSettingsBuilder>

The action that configures the serialization.

Returns:

EditorBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.Serialization(d =&gt; d.Custom("htmlSerialization"))
)
&lt;script&gt;
function htmlSerialization(html) {
return html.replace(/(&lt;\/?)b(\s?)/, "$1strong$2");
}
&lt;/script&gt;

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

C#
public EditorBuilder StyleSheets(Action<EditorStyleSheetBuilder> configurator)
Parameters:configuratorAction<EditorStyleSheetBuilder>

The action that configures the StyleSheets settings.

Returns:

EditorBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.StyleSheets(styleSheets =&gt; styleSheets.Add("editorStyles.css"))
)

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

C#
public EditorBuilder Tag(string tagName)
Parameters:tagNamestring

The tag that will be rendered as contentEditable

Returns:

EditorBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.Tag("div")
)

Configures the available tools in the toolbar.

C#
public EditorBuilder Tools(Action<EditorToolFactory> configurator)
Parameters:configuratorAction<EditorToolFactory>

The action that configures the tools.

Returns:

EditorBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.Tools(tools =&gt; tools
.Clear()
.Bold()
.Italic()
.Underline()
)
)

When set to false, the decoration applied by the Formatting tool dropdown will be skipped and the values will appear as plain text options.

C#
public EditorBuilder UnsafeInline(bool value)
Parameters:valuebool

The value that configures the unsafeinline.

Returns:

EditorBuilder

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

C#
public EditorBuilder Value(Action value)
Parameters:valueAction

The action that renders the HTML content.

Returns:

EditorBuilder

Example:
C#
@(Html.Kendo().Editor()
.Name("Editor")
.Value(@&lt;text&gt;
&lt;blockquote&gt;
According to Deep Thought, the answer to the ultimate question of
life, the universe and everything is &lt;strong&gt;42&lt;/strong&gt;.
&lt;/blockquote&gt;
&lt;/text&gt;)
)

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

C#
public EditorBuilder Value(Func<object, object> value)
Parameters:valueFunc<object, object>

The predicate that renders the HTML content.

Returns:

EditorBuilder

Example:
C#
@(Html.Kendo().Editor()
.Name("Editor")
.Value(@&lt;text&gt;
&lt;blockquote&gt;
According to Deep Thought, the answer to the ultimate question of
life, the universe and everything is &lt;strong&gt;42&lt;/strong&gt;.
&lt;/blockquote&gt;
&lt;/text&gt;)
)

Sets the HTML content that will show initially in the Editor as a string.

C#
public EditorBuilder Value(string value)
Parameters:valuestring

An HTML string.

Returns:

EditorBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.Value("&lt;blockquote&gt;A towel has &lt;strong&gt;immense&lt;/strong&gt; psychological value&lt;/blockquote&gt;")
)