Skip to main content
.NET Framework 4.5.2+

SelectionCollection.Unselect(DocumentRange) Method

Unselects a specified range.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v22.2.Core.dll

NuGet Package: DevExpress.RichEdit.Core


public void Unselect(
    DocumentRange range


Name Type Description
range DocumentRange

A DocumentRange to unselect.


If the specified range is partially selected (intersects with selected ranges), selections are updated so that the specified range is not selected. If the specified range is not selected, it remains unselected.


View Example

document.LoadDocument("SelectionCollection.docx", DocumentFormat.OpenXml)
Dim startPos As Integer = 80
Dim endPos As Integer = document.Tables(0).Rows(1).LastCell.ContentRange.Start.ToInt()
Dim myRange As DocumentRange = document.CreateRange(startPos, endPos - startPos)
Dim unselectRange As DocumentRange = document.CreateRange(140, 200)

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Unselect(DocumentRange) method.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also