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

Persist TrackChanges

3 Answers 71 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 04 Jul 2017, 01:28 PM

Is it possible to save a RadRichTextBox RadDocument with IsTrackChangesEnabled so that it can be reloaded and the changes still be visible?

I need to save the document to a database (or file system) and then load it on a different PC/user later on for review.

I presume it needs to be Exported using a FormatProvider - but can't find any documentation detailing the steps.

Thanks

3 Answers, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 07 Jul 2017, 07:28 AM
Hi Andrew,

You are right - you will need to save the document using a format provider and reload it back to show in a different machine/application. You can find information on how to use the different format providers of RadRichTextBox in the Import/Export section of the documentation. Note that the track changes are currently preserved only when exporting to DOCX and XAML. Would these formats suit your needs? 

Regards,
Tanya
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
Andrew
Top achievements
Rank 1
answered on 10 Jul 2017, 07:59 PM

Thanks for the reply.

Could you clarify a few points:

I'm using RadDocument (not RadFlowDocument) - so presumably there is no DocX format provider I need to use the OpenXml provider. But the only object under the DocX namespace is the DocxExportSettings!

Dim docx As New Telerik.Windows.Documents.FormatProviders.OpenXml.Docx.DocxExportSettings

I have tried using the Xaml format provider but the changes didn't appear when the data was reloaded:

Dim xaml As New Telerik.Windows.Documents.FormatProviders.Xaml.XamlFormatProvider

Dim changes As String = xaml.Export(radDocument)

I'm then saving changes to the database and then reloading when required using this

richTextBox.Document = xaml.Import(changes)

In both cases I have set IsTrackChangesEnabled = True before importing or exporting the text.

I'm currently using the 2016.2.613.45 release for WPF.

Could you provide some guidance.

Thanks

Andrew

0
Tanya
Telerik team
answered on 13 Jul 2017, 02:26 PM
Hi Andrew,

The namespace you are using is the correct one and you should be able to use the DocxFormatProvider of RadRichTextBox.

I created a sample project to demonstrate the functionality. In this sample, a new RadDocument instance is created and the content is modified while the Track Changes is enabled. The content with the revisions is then exported to XAML and to DOCX using the respective providers. I tested importing back both documents and everything seems to be working as expected. Could you please test it on your end as well and let me know how it works for you?

Regards,
Tanya
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
RichTextBox
Asked by
Andrew
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or