Unplanned
Last Updated: 06 May 2016 14:13 by ADMIN
ADMIN
Dimitar
Created on: 07 Apr 2016 13:58
Category: RichTextEditor
Type: Bug Report
4
FIX. RadRichtextEditor – exceptions when using RadDocument API on already measured document
To reproduce:
- insert a fragmet from another RichtextEditor like this:
private void Button_Click(object sender, RoutedEventArgs e)
{
radRichTextBox.Document.Sections.Clear();
radRichTextBox.Document.Sections.Add(new Section());

radRichTextBox.Document.CaretPosition.MoveToLastPositionInDocument(); 
radRichTextBox.DocumentEditor.InsertParagraph();
radRichTextBox.DocumentEditor.InsertFragment(new DocumentFragment(radRichTextEditor1.Document));
radRichTextBox.DocumentEditor.InsertParagraph();
}

Workaround:
There is no point of resetting the section in such way. Nevertheless, you can avoid the exception by using one of the following methods:

radRichTextBox.Document.MeasureAndArrangeInDefaultSize();
radRichTextBox.UpdateEditorLayout();
1 comment
ADMIN
Stefan
Posted on: 25 Apr 2016 14:41
If a layout is performed on an instance of RadDocument (e.g. the document is visualized in RadRichTextEditor, or the document is imported/exported with a format provider), some actions can cause exceptions, for example:
-	Moving the caret position
-	Exporting with format providers
-	Doing any edits through RadRichTextEditor or RadDocumentEditor. 

Workaround: This can be avoided by using RadDocumentEditor class for all edits of already created document. RadDocument API should be used only for creating documents from scratch.