Back to Devexpress

Selection

aspnetcore-401632-rich-edit-selection.md

latest2.9 KB
Original Source

Selection

  • Sep 09, 2024

The RichEdit client API available using the selection property allows you to access and modify selections in a document.

The control keeps the following information about selection:

Example: in the image below, three intervals are selected. The last interval is selected from right to left. In this case, the properties return the following values.

Set Selection

Selection API allows you to set a cursor position (selection with zero length), select a document interval, multiple intervals, or the entire sub-document. The table below lists methods that allow you to set selection.

Selected elementMethodExample
Set the cursor positionsetSelection(position)richEdit.selection.setSelection(5);
Select an intervalsetSelection(interval)richEdit.selection.setSelection(new DevExpress.RichEdit.Interval(4, 10));
Select several intervalssetSelection(interval[])richEdit.selection.setSelection([{start: 0, length: 3}, {start: 28, length: 9}]);
Select the entire sub-documentselectAllrichEdit.selection.selectAll();

See Also

Examples