Gets or sets the position of the caret within the document.
A DocumentPosition object, representing the current caret position.
Use this property to insert text at the current cursor position or to access the paragraph where the cursor is located (the ReadOnlyParagraphCollection.Get method).
When working with headers/footers, use the DocumentPosition.BeginUpdateDocument - DocumentPosition.EndUpdateDocument pair to get the correct position. Otherwise an InvalidOperationException is thrown.
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the CaretPosition property.
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.