Clone RadDocument

1 Answer 41 Views
RichTextBox
Emin Sadigov
Top achievements
Rank 1
Iron
Veteran
Iron
Emin Sadigov asked on 21 Sep 2023, 02:26 PM | edited on 21 Sep 2023, 02:26 PM

Hello,

Can I use any method to clone RadDocument.

Before I`ve used Export -> Import using DocxFormatProvider. But this practic sometime return error (when TrackChange enabled and images were removed, then export ok, but import return MergeBoxNodes Nullreference error).

I just need to clone RadDocument to store second variant without the changes (clone and accept all changes).

Any ideas?

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 25 Sep 2023, 07:03 AM

Hello Emin,

You can use the following method for this: 

 var newDocument = radRichTextBox.Document.CreateDeepCopy() as RadDocument;

It appears that the issue that how have specified is already resolved as well: RichTextBox: NullReferenceException when importing document exported with DocxFormatProvider, containing several images with track changes.

I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
RichTextBox
Asked by
Emin Sadigov
Top achievements
Rank 1
Iron
Veteran
Iron
Answers by
Dimitar
Telerik team
Share this question
or