Currently the editing methods of RadRichTextBox and RadDocumentEditor work with the current DocumentSelection and CaretPosition for the current RadDocument. In order to execute an editing action on specific range/position, current selection/position should be moved, which is not always desirable. Also, as a side effect, when moving current selection or position, the scroll offset of the document shown in RadRichTextBox is changed.
Think of the following approaches:
- Do not scroll the document around when API methods are executed. There is convenient API which could be called to scroll the document when needed. (This will fix the problem only partially).
- Provide version of the IDocumentEditor methods that accept DocumentSelection or DocumentPosition as parameters, and work with them instead of with the RadDocument.Selection and RadDocument.CaretPosition, similar to InsertFragment(DocumentFragment documentFragment, DocumentPosition documentPosition) and InsertInline(Inline inline, DocumentPosition documentPosition).