Skip to main content

ejRichTextEditor

Namespace: Wisej.Web.Ext.Syncfusion

Assembly: Wisej.Web.Ext.Syncfusion (4.1.0.0)

Rich text editor is a component that help you to display or edit the content including tables, hyperlinks, paragraphs, lists, video, and images. The editor supports file and folder management using FileExplorer component.

public class ejRichTextEditor : ejBase

Constructors​

Instance member ejRichTextEditor()​

Constructs a new instance of the ejRichTextEditor class.

Example:

The following example creates the editor, shows the footer through the options and sets the initial content.

var editor = new ejRichTextEditor();
editor.Options.showFooter = true;
editor.Text = "<p>Dear <b>customer</b>,</p>";
editor.Dock = DockStyle.Fill;
this.Controls.Add(editor);

Instance member ejRichTextEditor(options)​

Constructs a new instance of the ejRichTextEditor class.

NameTypeDescription
optionsObjectInitial set of options.

The control creates the Syncfusion ejRTE widget.

Example:

The following example creates an editor with a toolbar limited to the text styles, the lists and the undo and redo actions.

var editor = new ejRichTextEditor(new
{
toolsList = new[] { "style", "lists", "doAction" },
tools = new
{
style = new[] { "bold", "italic", "underline" },
lists = new[] { "unorderedList", "orderedList" },
doAction = new[] { "undo", "redo" }
}
});
editor.Dock = DockStyle.Fill;
this.Controls.Add(editor);

Properties​

Instance member Text​

String: Returns or sets the HTML content of the editor. (Default: "")

Assigning the property updates the content of the widget in the browser by calling its setHtml function. The HTML edited by the user is sent back to the server and assigned to this property, which raises the TextChanged event.

Example:

// load the HTML content.
this.editor1.Text = "<h2>Release notes</h2><p>First <i>draft</i>.</p>";

// save the HTML edited by the user, i.e. in the handler of a button.
File.WriteAllText(filePath, this.editor1.Text);

Methods​

Protected member OnWebUpdate(state)​

Processes changes between client and server.

ParameterTypeDescription
stateObject

Instance member Update()​

Causes the control to update the corresponding client side widget. When in design mode, causes the rendered control to update its entire surface in the designer.

When the control is being created on the client, i.e. when the user reloads the page, and the Text property is not empty, the method also sends the HTML content to the widget.

Example:

The following example changes a nested option, which is not detected automatically, and updates the widget.

// the "tools" option was defined when the editor was created.
this.editor1.Options.tools.style = new[] { "bold", "italic", "underline", "strikethrough" };
this.editor1.Update();

Implements​