This is a migrated thread and some comments may be shown as answers.

Moving content around document - bookmarks?

3 Answers 82 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Charles
Top achievements
Rank 1
Charles asked on 06 Mar 2012, 06:38 PM
Hi

I have various Permission Ranges one after another, each followed by a carriage return.  My aim is to reorder these ranges.

I've managed to cobble together some code that deletes the range of the one I want to remove and it inserts a fragment (fragment obtained prior to deletion via CopySelectedDocumentElements).

This mainly works... except if I have bookmarks in the range I want to copy, they get deleted.  It would appear that copying the selected elemtents to a fragment ignores Bookmarks.

Any suggestions or workarounds welcome!

Charlie

3 Answers, 1 is accepted

Sort by
0
Charles
Top achievements
Rank 1
answered on 07 Mar 2012, 03:07 PM
I've done a little more investigation, and it would appear that the reason the bookmarks don't copy is that the "IsCopyable" property is false.

So... I tried sub-classing BookmarkRangeStart and BookmarkRangeEnd, and setting IsCopyable to true.  Now the bookmarks copy, but the pairing gets broken when they're re-inserted into a document.

I assume that there are other overrides required to handle the re-pairing of ranges when copied - but the documentation is a bit lacking in this area.  On the basis that Hyperlinks are copyable, I'd assume this is definitely achievable!

As before, any help gladly received!
0
Charles
Top achievements
Rank 1
answered on 08 Mar 2012, 05:10 PM
... and if I'd actually overridden "IsCopyable" to "true" in the "End" marker, it would've worked!
0
Iva Toteva
Telerik team
answered on 09 Mar 2012, 10:14 AM
Hi Charles,

You are right, implementing a custom annotation range and setting the IsCopyable property to True to both the range start and range end is the key to achieving the desired behavior.
If you need further assistance, let us know how we could help.

Greetings,
Iva Toteva
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
RichTextBox
Asked by
Charles
Top achievements
Rank 1
Answers by
Charles
Top achievements
Rank 1
Charles
Top achievements
Rank 1
Iva Toteva
Telerik team
Share this question
or