Completed
Last Updated: 05 Jul 2022 14:33 by ADMIN
Release LIB 2022.2.711 (11 Jul 2022)
Daniel
Created on: 07 Oct 2021 13:15
Category: RichTextBox
Type: Bug Report
0
RichTextBox: Pasting a paragraph followed by a table in a document with tracked changes only marks the paragraph as changed
  1. In MS Word, create a table with text in every cell, but just before the table, add a paragraph with text (you cannot reproduce the problem with an empty paragraph)
  2. In the RadRichTextBox, create a new document
  3. Activate Review/Track Changes
  4. Copy and paste all the content from MS Word >> as a result none of the cells in the table has change tracking markup
  5. If you copy only the table from MS Word (without the non-empty paragraph), it is working as expected
2 comments
ADMIN
Tanya
Posted on: 17 Jun 2022 12:38

Hi Daniel,

I am sorry to hear about the inconvenience this issue is causing you. I agree with you that this behavior needs to be fixed but at this point, a fix is still not available. The team is doing their best to fix issues in the control but since this one is not planned, I cannot say a specific time frame when this one can be fixed. 

What I can suggest working around the issue with the current version is to intercept the paste operation and insert the block from the document one ny one:

private void RadRichTextBox_CommandExecuting(object sender, Telerik.Windows.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
{
    if (e.Command is PasteCommand)
    {
        e.Cancel = true;
        this.radRichTextBox.CommandExecuting -= this.RadRichTextBox_CommandExecuting;

        RadDocument documentFromClipboard = ClipboardEx.GetDocument().ToDocument();
        RadDocumentEditor editor = new RadDocumentEditor(documentFromClipboard);
        DocumentPosition pos = new DocumentPosition(documentFromClipboard);

        foreach (var block in documentFromClipboard.Sections.First.Blocks)
        {
            documentFromClipboard.Selection.Clear();

            pos.MoveToDocumentElementStart(block);
            documentFromClipboard.Selection.AddSelectionStart(pos);

            pos.MoveToDocumentElementEnd(block);
            documentFromClipboard.Selection.AddSelectionEnd(pos);

            if (!documentFromClipboard.Selection.IsEmpty)
            {
                editor.Copy();
                this.radRichTextBox.Paste();
            }
        }

        this.radRichTextBox.CommandExecuting += this.RadRichTextBox_CommandExecuting;
    }
}

Hope this will fit your needs.

Regards,
Tanya
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.

Daniel
Posted on: 10 Jun 2022 20:25
The problem still exists as described in October. It is causing many problems when Accepting or Rejecting changes because the text in the table cells is not marked with the inserted mark up.