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

Bug when pasting from Excel?

6 Answers 128 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Helmut
Top achievements
Rank 1
Helmut asked on 20 Mar 2013, 07:37 PM
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?

6 Answers, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 25 Mar 2013, 09:57 AM
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.

0
John
Top achievements
Rank 1
answered on 08 Apr 2020, 06:08 PM

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

0
Martin
Telerik team
answered on 13 Apr 2020, 08:03 AM

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.
0
John
Top achievements
Rank 1
answered on 13 Apr 2020, 04:53 PM

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


0
Martin
Telerik team
answered on 14 Apr 2020, 03:31 PM

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.
0
John
Top achievements
Rank 1
answered on 17 Apr 2020, 01:35 PM

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

Tags
RichTextBox
Asked by
Helmut
Top achievements
Rank 1
Answers by
Boby
Telerik team
John
Top achievements
Rank 1
Martin
Telerik team
Share this question
or