Persist TrackChanges

4 posts, 0 answers
  1. Andrew
    Andrew avatar
    4 posts
    Member since:
    Jun 2015

    Posted 04 Jul Link to this post

    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

  2. Tanya
    Admin
    Tanya avatar
    564 posts

    Posted 07 Jul Link to this post

    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 allow you to write beautiful native mobile apps using a single shared C# codebase.
  3. Andrew
    Andrew avatar
    4 posts
    Member since:
    Jun 2015

    Posted 10 Jul Link to this post

    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

  4. Tanya
    Admin
    Tanya avatar
    564 posts

    Posted 13 Jul Link to this post

    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 allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top