Bug when pasting from Excel?

7 posts, 0 answers
  1. Helmut
    Helmut avatar
    3 posts
    Member since:
    Jan 2013

    Posted 20 Mar 2013 Link to this post

    Somehow, pasting content from MS Excel seems to mess up something. For testing purposes, I set up a Window, using the Wizard for the RadRichTextBox, selecting "Word Processor", leaving all other choices at their defaults. Additionally, I added an event handler for the "CommandError" event of the RadRichTextBox.

    If I try to paste from Excel, the CommandError event is triggered (except, when only one cell is copied) and the Exception in it has this StackTrace:

    System.NullReferenceException: Object reference not set to an instance of an object.
       at Telerik.Windows.Documents.Model.RadDocument.SplitCurrentParagraph(DocumentPosition position, Paragraph paragraphToCopyPropertiesFrom) in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Model\RadDocument.cs:line 5251
       at Telerik.Windows.Documents.Model.RadDocument.InsertFragmentInternal(DocumentPosition position, DocumentFragment fragment) in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Model\RadDocument.cs:line 5318
       at Telerik.Windows.Documents.Model.RadDocument.InsertFragment(DocumentFragment fragment, DocumentPosition position) in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Model\RadDocument.cs:line 1463
       at Telerik.Windows.Documents.Model.RadDocument.InsertFragment(DocumentFragment fragment) in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Model\RadDocument.cs:line 1425
       at Telerik.Windows.Documents.Commands.InsertFragmentCommand.ExecuteInsertCore(InsertFragmentCommandContext context) in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Commands\InsertFragmentCommand.cs:line 10
       at Telerik.Windows.Documents.Commands.InsertCommandBase`1.ExecuteOverride(T context) in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Commands\InsertCommandBase.cs:line 22
       at Telerik.Windows.Documents.Commands.DocumentCommandBase`1.Execute(DocumentCommandContextBase context) in c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Documents\Core\Commands\DocumentCommandBase.cs:line 50

    The pasted content is not visible. But after for example resizing the window, or scrolling the document, it gets visible. But from now on the editor is more or less unusable:
    • The visible caret stays at the last position, no matter where I click in the document (but the "real position" moves)
    • All changes, made in the editor, like typing text, inserting images, get only visible, after the again the window is resized or the document is scrolled.
    • Those changes are made, where the "real position" of the caret is, but the caret is shown still either at the original position before the paste or not at all.
    The same happens with the demo application!
    Is this a bug or am I missing some special requirements to paste from Excel?
  2. Boby
    Admin
    Boby avatar
    763 posts

    Posted 25 Mar 2013 Link to this post

    Hi Helmut,
    Unfortunately this is a bug in RadRichTextBox, most probably related to the RTF format provider (which is internally used when importing content from Excel). We will log the issue and will try to fix it in a future release.

    Please, excuse us for the inconvenience. We have added points to your account for the report. Don't hesitate to contact us if you have other questions.



    Regards,
    Boby
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. John
    John avatar
    14 posts
    Member since:
    Jul 2019

    Posted 08 Apr 2020 in reply to Boby Link to this post

    Hi,

    Is this still an issue or did it get fixed?  If it's the same issue, I'm getting a NullReferenceException on this method call in the StackTrace:

    Telerik.Windows.Documents.HierarchicalIndex.GetHierarchicalIndexByBox(LayoutBox currentBox, Int32 indexInInline)

    ...when pasting an unformatted table in into a RichTextBox (from Excel (Build 11929) and using Telerik version 2019.2.618.45).

    Best regards

    John

  4. Martin
    Admin
    Martin avatar
    127 posts

    Posted 13 Apr 2020 Link to this post

    Hello John,

    I would like to ask you to send us the document which you copy the content from in order to reproduce this behavior. I must assure you that we treat all client files in a strictly confidential manner and for testing purposes only.

    Regards,
    Martin
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
  5. John
    John avatar
    14 posts
    Member since:
    Jul 2019

    Posted 13 Apr 2020 in reply to Martin Link to this post

    Hello Martin,

    Thanks very much for your reply.  It was just a basic table to test functionality as per the attached image.Happy to send the actual file if you can tell me where to post it, but predictably I can now no longer reproduce the issue.  If I'm able to successfully reproduce I'll post back with steps.

    Thank you very much for following up.

    Best regards

    John


  6. Martin
    Admin
    Martin avatar
    127 posts

    Posted 14 Apr 2020 Link to this post

    Hello John,

    It seems the described behavior is related to this issue: RichTextBox: The layout updates stop as a result a handled NullReferenceException after pasting a table with an empty first cell as the first element in the document

    This bug is fixed with Release 2019.3.1209 (12/09/2019).

    Regards,
    Martin
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
  7. John
    John avatar
    14 posts
    Member since:
    Jul 2019

    Posted 17 Apr 2020 in reply to Martin Link to this post

    Thanks very much Martin.  I've now bumped up to 2020.1 so it sounds like I'm all good.  Thanks very much for following up.

    Best regards

    John

Back to Top