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();