I tried replicating the issue you are observing with the code you provided but was unable to. Further, we are unaware of cases where the Selection.Clear() method does not work properly.
However, when it comes to annotations, selecting them and replacing their content requires special attention. This is so as the SkipPositionBefore
property of annotation markers affects the behavior. For example, the end marker of a bookmark has this property set to true so selecting its content and inserting in its place will result in the content being inserted after the annotation end.
That said would you mind sharing what type of annotations you are selecting exactly? Any additional details you feel are relevant will also be appreciated.
On a side note, I suggest you modify the code that selects the content of the annotation to use the SelectAnnotationRange() method as it is not recommended to modify the caret position that often and the implemented logic might cause issues.
I am looking forward to your reply.
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>