To reproduce:
- Copy the content from the attached document - do not copy the last row.
- Remove the bookmarks like this:
bookmarks = radRichTextEditor1.Document.GetAllBookmarks().ToArray();
foreach (BookmarkRangeStart item in bookmarks)
{
radRichTextEditor1.Document.GoToBookmark(item);
radRichTextEditor1.DocumentEditor.DeleteBookmark(item);
}
Workaround:
var invalidStarts = this.radRichTextBox.Document
.EnumerateChildrenOfType<BookmarkRangeStart>()
.Where(start => start.End == null)
.ToList();
foreach (var invalidStart in invalidStarts)
{
invalidStart.Parent.Children.Remove(invalidStart);
}
Note that when this workaround is used the document history will be deleted as well, which means that the undo operation will no longer hold information for previous operations