Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
  [Expand]Reporting
  [Expand]Chart Control
  [Expand]Grid View
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Spreadsheet
  [Collapse]Rich Text Editor
   [Expand]Product Information
   [Expand]Concepts
   [Collapse]Examples
     How to: Change the Mail Merge data sources at runtime
     How to: Define the default page settings such as margins, paper kind, landscape etc
     How to: Get a selected text on the client side
     How to: Insert RTF text to a document
     How to: Insert text to the end of the document on the client side
     How to: Merge several documents content into a single document
     How to: Open a document using drag-and-drop
     How to: Open SpellChecker dialog via Ribbon
     How to: Save and load documents from a database
     How to: Save words added via the Add to Dictionary option to a custom physical dictionary
     How to: Upload a document in the working directory using drag-and-drop
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Site Navigation and Layout
  [Expand]File Management
  [Expand]Multi-Use Site Controls
  [Expand]Scheduler
  [Expand]HTML Editor
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gauges
  [Expand]Data Editors
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Get a selected text on the client side

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T449266.

This example demonstrates how to get selected text on the client side. The ASPxRichEdit client-side API provides the selection property that allows you to select a text range in code or obtain the selected range's Interval object. This object can be used to receive the selected text: all text is stored within sub-documents, following the ASPxRichEdit document model structure. Thus, get an active sub-document using the client-side document property and use the text array to access the selected text range. If you need to receive all text in the active sub-document, you can get the entire text array.

How would you rate this topic?​​​​​​​