Performance on removing multiple AnnotationRanges

2 posts, 0 answers
  1. Charles
    Charles avatar
    41 posts
    Member since:
    Mar 2012

    Posted 03 Dec 2012 Link to this post


    I have a specific requirement that involves removing a number of annotation ranges at a time.  The only way I can see of doing this is via the Document "Delete" commands to remove them one at a time (some of these are read only ranges, so I can't just create a selection across them all and Delete the selection).

    I've stepped through the code and the process of removing these individually called "EnsureDocumentArrangedAndMeasured" after each one is removed, which for a large file absolutely kills the performance.  Is there any way I can improve this?


  2. Boby
    Boby avatar
    636 posts

    Posted 05 Dec 2012 Link to this post

    Hi Charles,
    What could perform better is RadDocument.DeleteCustomAnnotationRange method, enclosed in RadDocument.BeginUpdate and EndUpdate:
    foreach (var annotationRangeStart in this.radRichTextBox.Document.GetAnnotationMarkersOfType<AnnotationRangeStart>().Reverse().ToList())

    Kind regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top