Show theme settings Shopping cart Download trialFree Trial
Change Theme Settings
Change Theme Settings
Themes
 
Show All Themes
v
...v

Client-Side Selection

  • Undo (Ctrl+Z)
  • Redo (Ctrl+Y)
  • Align Left (Ctrl+L)
  • Align Center (Ctrl+E)
  • Align Right (Ctrl+R)
  • Justify (Ctrl+J)
  • v

This demo shows how to interact with the editor's selection using the client-side API.

The ASPxHtmlEditor provides a comprehensive API, allowing you to access and modify the currently selected content at the client side. To access the selection, use the editor's GetSelection client function, which returns an ASPxClientHtmlEditorSelection class instance. With methods of this class, you can perform your tasks on the selection. In this demo, the ASPxClientHtmlEditorSelection.GetElements client function is used to access the selection's HTML elements (XML DOM nodes). These elements are used then to retrieve references to text nodes and modify their values based on the case update method (see the demo's ChangeCase JavaScript function). You can select the case update method via the corresponding toolbar dropdown menu.

Note that the selection API is available only in the Design View.

Collapse/Expand
Local Copy of this Demo
To inspect the source code for this demo on your machine, you must first install our components via the DevExpress Component Installer.
You can open a local copy of this online demo directly from this webpage (if using v20.2.8, 21.1.4 or higher).
Open CS Solution
Open VB Solution
The source code files for this demo are installed (by default) in the following directories:
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\CS\ASPxHTMLEditorDemos
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\VB\ASPxHTMLEditorDemos