THEMES
THEME SETTINGS

Rich Text Editor - API Client Command API

  • Undopo
    Undo
  • Cut
    Clipboardpo
    Clipboard
  • v
    v
    po
    po
    po
    Fontpo
    dialogboxlauncherFont
  • po
    po
    Paragraphpo
    dialogboxlauncherParagraph
  • Stylespo
    Styles
  • Editing
  • Table Style Optionspo
    Table Style Options
  • Table Stylespo
    Table Styles
  • v
    v
    Borders & Shadingspo
    dialogboxlauncherBorders & Shadings
  • Navigation
  • Options
  • Header from Top:
    +
    -
    Footer from Bottom:
    +
    -
    Positionpo
    Position
  • Close
  • v
    Shape Stylespo
    Shape Styles
  • dialogboxlauncherArrange

The ASP.NET MVC Rich Text Editor (RichEdit) provides a comprehensive API, allowing you to manipulate the open document programmatically on the client side. The available client manipulation API is exposed through the following properties.

  • document
    Provides access to structures that allow you to obtain the current information about certain document structural elements (such as sections, active sub-document, styles for characters, paragraphs and tables, and etc.).
  • selection
    Provides access to a set of methods that allow you to position the cursor within a document and to select document content elements.
  • commands
    Provides access to client commands that allow you to programmatically accomplish virtually any task within a document (such as inserting characters, paragraphs, tables and pictures, changing element formatting, creating numbered lists, etc.).

Available commands are a powerful tool for manipulating document content on the client using code. Most commands replicate the RichEdit's default UI commands available through the editor's ribbon. These commands are useful when you are required to implement a custom toolbar for the RichEdit instead of the default built-in ribbon. For an example of such a custom toolbar, refer to the Custom Toolbar via Client API demo.

Each command exposes the execute and getState methods. For its execution, a command may require additional data to be passed as the execute method's parameter. The execute method may result in no action taken if a command's state obtained using the getState method does not allow command execution (for instance, in case when a command is not enabled in the ribbon).

This demo is an illustration of how the client API for commands and selection can be used in the RichEdit.

Version: v2017 vol 1.7
Copyright © 2006-2017 Developer Express Inc
Your Next Great MVC App Starts Here

Get started today and download your 30-day trial of DevExpress MVC Extensions (includes 30 days of free technical support).

All demos ship with full source code and are included in the DevExpress MVC distribution. Refer to the Demos and Sample Applications topic to learn more.

DevExpress MVC Extensions ship as part of DevExpress Universal, DXperience and ASP.NET Subscriptions and are backed by a 60 day unconditional money-back guarantee.
To learn more and obtain pricing information, visit the Compare Features and Pricing webpage. For immediate assistance, contact us by Email at info@devexpress.com or by phone at +1 (818) 844-3383 between 7:30am and 4:30pm Pacific Time.