Obtaining information and elements from the selection: AddParagraphToSelection(): Adds a paragraph to the existing selection.AddTableCellToSelection(): Adds a table cell to the existing selection.AddDocumentElementToSelection(): Adds a specified document element to the existing selection.There are two overloads that allow you to pass a cell from the column or the table and the grid column index, which should be selected. SelectTableColumn(): Creates a new selection containing all the cells in a table column.
IsEmpty: Holds a value determining whether the selection is empty or not.Ranges: Holds a collection of all SelectionRange instances in the selection.
To learn more about the DocumentPosition read the Positioning topic. You can manage the selection by either using the Selection property of RadDocument or by creating an instance of the DocumentSelection class. The instance of the class gets associated with the RadDocument of RadRichTextBox and allows you to specify selection start and end positions, selection ranges and other. The programmatic selection is represented via the DocumentSelection class. This can be used in a lot of scenarios involving editing of the document, or for example, when implementing Search functionality in your RadRichTextBox and you want to select the found string. The developer is allowed to manipulate the selection programmatically. = new (Colors.Red) = 0.2 = .DarkRed Me.radRichTextBox.SelectionFill = New SolidColorBrush(Colors.Red) Ме. = 0.2 Ме.radRichTextBox.SelectionStroke = Brushes.DarkRed Figure 1: Custom selection colors