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

Copy RadDocument

1 Answer 75 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
FU
Top achievements
Rank 2
FU asked on 07 Apr 2011, 08:34 AM
Hi

I'm trying to replace some variables in a document when saving it. I want it done as it saves the document so that the saved file contains the replacements and the document in the editor is not changed. Saving the document and replacing the variables works but the changes are made in the RadDocument in the editor. Is it possible to make a copy of the RadDocument in the editor, make the changes in the copy and save it?

Claus

1 Answer, 1 is accepted

Sort by
0
Mike
Telerik team
answered on 08 Apr 2011, 02:01 PM
Hi FU,

It is possible to create a copy of the document by exporting and then importing it with the XamlFormatProvider. It will create an identical copy of the document, however you should have in mind that all UIElements inside InlineUIContainer will be cloned and their settings might be different from the actual ones and event handlers might not work.
Another option for you may be to use Undo several times. This will be possible if you use the API of and commands of RadRichTextBox to modify the document only. Change made using the API of RadDocument are often not undo-able and document history would be cleared in these cases.
Let us know if you have more questions.

Regards,
Mike
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
RichTextBox
Asked by
FU
Top achievements
Rank 2
Answers by
Mike
Telerik team
Share this question
or