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

Defines the fluent API for configuring the Telerik UI for ASP.NET Core Editor.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class EditorBuilder : WidgetBuilderBase<Editor, EditorBuilder>, IHtmlContent

Inheritance: objectHelperResultWidgetBuilderBase<Editor, EditorBuilder>EditorBuilder

Implements: IHtmlContent

Inherited Members WidgetBuilderBase<Editor, EditorBuilder>.ToComponent()WidgetBuilderBase<Editor, EditorBuilder>.Expression(string)WidgetBuilderBase<Editor, EditorBuilder>.Explorer(ModelExplorer)WidgetBuilderBase<Editor, EditorBuilder>.Name(string)WidgetBuilderBase<Editor, EditorBuilder>.Deferred(bool)WidgetBuilderBase<Editor, EditorBuilder>.HtmlAttributes(object)WidgetBuilderBase<Editor, EditorBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<Editor, EditorBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<Editor, EditorBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<Editor, EditorBuilder>.Render()WidgetBuilderBase<Editor, EditorBuilder>.ToHtmlString()WidgetBuilderBase<Editor, EditorBuilder>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<Editor, EditorBuilder>.ToClientTemplate()WidgetBuilderBase<Editor, EditorBuilder>.AsModule(bool)WidgetBuilderBase<Editor, EditorBuilder>.ComponentWidgetBuilderBase<Editor, EditorBuilder>.ContainerHelperResult.WriteTo(TextWriter, HtmlEncoder)HelperResult.WriteActionobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the EditorBuilder class with the specified Editor component.

C#
public EditorBuilder(Editor component)
Parameters:componentEditor

The Editor component to be configured.

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

Returns the current instance of EditorBuilder to allow method chaining.

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.

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

The EditorDeserializationSettingsBuilder for the deserialization setting.

Returns:

EditorBuilder

Returns the current instance of EditorBuilder .

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 for Domain

Returns:

EditorBuilder

Returns the current EditorBuilder instance.

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

Indicates whether the Editor should submit encoded HTML tags. By default, the submitted value is encoded.

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

The value for Encoded

Returns:

EditorBuilder

Returns the current EditorBuilder instance.

Configures the client-side events.

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

The client events action.

Returns:

EditorBuilder

Returns the current EditorBuilder instance.

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

Returns the current instance of EditorBuilder to allow method chaining.

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

Configuration for file browser dialog.

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

The EditorFileBrowserSettingsBuilder for the filebrowser setting.

Returns:

EditorBuilder

Returns the current instance of 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(bool value)
Parameters:valuebool

The value for FormattingMarksRefreshDelay

Returns:

EditorBuilder

Returns the current instance of EditorBuilder to allow method chaining.

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 for FormattingMarksRefreshDelay

Returns:

EditorBuilder

Returns the current EditorBuilder instance.

Configuration for image browser dialog.

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

The EditorImageBrowserSettingsBuilder for the imagebrowser setting.

Returns:

EditorBuilder

Returns the current instance of EditorBuilder .

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

C#
public EditorBuilder Immutables()
Returns:

EditorBuilder

Returns the current instance of EditorImmutablesSettingsBuilder .

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 EditorImmutablesSettingsBuilder for the immutables setting.

Returns:

EditorBuilder

Returns the current instance of EditorBuilder .

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

Returns the current instance of EditorImmutablesSettingsBuilder .

Configures the import settings.

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

The action that configures the Import settings.

Returns:

EditorBuilder

Returns the current instance of EditorBuilder to allow method chaining.

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 for InlineHeight

Returns:

EditorBuilder

Returns the current EditorBuilder instance.

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 EditorMessagesSettingsBuilder for the messages setting.

Returns:

EditorBuilder

Returns the current instance of EditorBuilder .

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()
Returns:

EditorBuilder

Returns the current EditorBuilder instance.

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 for NavigateOnTab

Returns:

EditorBuilder

Returns the current EditorBuilder instance.

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 for Nonce

Returns:

EditorBuilder

Returns the current EditorBuilder instance.

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 EditorNonSplittableTagsOnPasteFactory for the nonsplittabletagsonpaste setting.

Returns:

EditorBuilder

Returns the current instance of 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 EditorPasteCleanupSettingsBuilder for the pastecleanup setting.

Returns:

EditorBuilder

Returns the current instance of EditorBuilder .

Configures the Kendo UI Editor PDF export settings.

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

The EditorPdfSettingsBuilder for the pdf setting.

Returns:

EditorBuilder

Returns the current instance of EditorBuilder .

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

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

The value for Placeholder

Returns:

EditorBuilder

Returns the current EditorBuilder instance.

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

Returns the current instance of EditorResizableSettingsBuilder .

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 EditorResizableSettingsBuilder for the resizable setting.

Returns:

EditorBuilder

Returns the current instance of EditorBuilder .

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

Returns the current instance of EditorResizableSettingsBuilder .

Allows setting of serialization options.

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

The EditorSerializationSettingsBuilder for the serialization setting.

Returns:

EditorBuilder

Returns the current instance of EditorBuilder .

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

Returns the current instance of EditorBuilder to allow method chaining.

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

The tag that will be rendered. Defaults to "textarea". Triggers the inline edit mode if different.

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

The value for Tag

Returns:

EditorBuilder

Returns the current EditorBuilder instance.

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

A collection of tools that are used to interact with the Editor. Tools may be switched on by specifying their name. Custom tools and tools that require configuration are defined as objects. The tools property can be a matrix - array of arrays. When defined in this manner, the tools in each internal array are grouped together.The available editor commands are: Basic text formatting - bold, italic, underline, strikethrough, subscript, superscript; Font and color - fontName, fontSize, foreColor, backColor; Alignment - justifyLeft, justifyCenter, justifyRight, justifyFull; Spacing - lineHeight; Lists - insertUnorderedList, insertOrderedList, indent, outdent; Links, images and files - createLink, unlink, insertImage, insertFile; Table editing - tableWizard, createTable, addColumnLeft, addColumnRight, addRowAbove, addRowBelow, deleteRow, deleteColumn; Structural markup and styles - formatting, cleanFormatting; Snippets - insertHtml; HTML code view - viewHtml; Print edited page - print; Export to PDF - pdf; Format painter - copyFormat, applyFormat or Formatting marks - formattingMarks.

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

The EditorToolFactory for the tools setting.

Returns:

EditorBuilder

Returns the current instance of EditorBuilder .

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 for UnsafeInline

Returns:

EditorBuilder

Returns the current EditorBuilder instance.

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

Returns the current instance of EditorBuilder to allow method chaining.

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

Returns the current instance of EditorBuilder to allow method chaining.

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

The content of the editor.

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

The value for Value

Returns:

EditorBuilder

Returns the current EditorBuilder instance.

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