Change Theme Settings
Change Theme Settings
Themes
 
Metropolis
Moderno
iOS
Material
Material Compact
Office 365
Mulberry
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.