We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Periodically throws InvalidOperationException - BeginTransaction without CommitTransaction when cut/copy paste cells

Thread ID:





142733 Feb 17,2019 06:56 PM UTC Apr 3,2019 09:51 AM UTC WinForms 10
Tags: Spreadsheet
Asked On February 17, 2019 06:56 PM UTC

This does not happen all the time but is happening enough when attempting to cut/copy and paste cells in a spreadsheet.

Included is a video of this occuring when I was recording.

I'd obviously want to not want this occuring but would also like a way to prevent these unanticipated issues from crashing the application and losing any unsaved work.

If you PM me then I can send more of the items across for attempting to repro and obtaining a full call stack when it does occur.

Attachment: VideoRepro_666491f9.zip

Arulraj A [Syncfusion]
Replied On February 18, 2019 09:58 AM UTC

Hi Spotty,  
Thanks for using Syncfusion product.  
We tried to reproduce the issue at our end with different combinations of PasteOptions and AllowPasteOptionPopup. However, we were unable to reproduce the issue. So, please provide us the below details that will helpful for us to provide a better solution.  
  • Call Stack and exception details of the issue.
  • The code that causes the reported scenario at your end.
  • Also refer the attached sample and let us know the changes from the issue reproduced sample.

Please let us know if you have any other concerns.  

Arulraj A 

Replied On February 19, 2019 11:06 PM UTC

I'm doing multiple cut/copy paste actions and it does not occur with regular frequency.   ie, I can do it once and it will fail and the next time it will succeed.

Call stacks that occur when it happens are:

System.InvalidOperationException: BeginTransaction without CommitTransaction
   at Syncfusion.Windows.Forms.Spreadsheet.History.HistoryManager.BeginTransaction(String s)
   at Syncfusion.Windows.Forms.Spreadsheet.SpreadsheetCopyPaste.Paste(GridRangeInfoList range, PasteOptions e)
   at Syncfusion.Windows.Forms.Spreadsheet.SpreadsheetCopyPaste.Paste(GridRangeInfoList range)
   at Syncfusion.Windows.Forms.Spreadsheet.SpreadsheetCopyPaste.Paste()
   at Syncfusion.Windows.Forms.CellGrid.SelectionController.HandleKeyDown(KeyEventArgs args)
   at Syncfusion.Windows.Forms.Spreadsheet.SpreadsheetGrid.ProcessKeyEventArgs(Message& m)
   at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
   at System.Windows.Forms.Control.WmKeyChar(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at Syncfusion.Windows.Forms.ScrollControl.WndProc(Message& msg)
   at Syncfusion.Windows.Forms.Spreadsheet.SpreadsheetGrid.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

If this helps.    I will endeavor to continue to get call stacks when it does occur and confirm that it is always occurring at the same point.

Mohanraj Gunasekaran [Syncfusion]
Replied On February 20, 2019 01:54 PM UTC

Hi Spotty, 
Thanks for using Syncfusion product. 
We have tried the cut/copy paste option using below attached sample in our latest Syncfusion  product version But the sample is working fine as we expected. Please let us know the exact use case to reproduce your reported scenario and let us know the below attached sample differ from your customization. It will be helpful us to investigate further. 
Mohanraj G 

Replied On February 21, 2019 04:12 PM UTC

As I stated the repro is not a stable repro and occurs periodically when testing my applications which is doing a lot of cut/copy/paste activities enough that it has become noticeable and was tracked when I was videoing a walkthrough of the application.    I can provide a repro project.   This is material that I would not like to be made publicly available but would like to fix the problem.

This code is the code on other cut/copy paste problems that have been encountered and your having problems reproing.    

As for the code - the cut/copy/paste actions have not user code.   These are merely taking cells in the spreadsheet and acting upon them using the default spreadsheet implementations so there is absolutely none of my code involved in the cut/copy paste functionality.    It case occured using either the context menu or Ctrl C,X and V shortcuts.

Arulraj A [Syncfusion]
Replied On February 22, 2019 04:42 PM UTC

Hi Spotty,   

Thanks for the update. 

Please mail your sample to support@syncfusion.com. We will check and update you. 

Arulraj A 

Replied On March 28, 2019 03:42 PM UTC

I believe I may have a reliable repro for this error which I'll send PM with repro steps.

Arulraj A [Syncfusion]
Replied On March 29, 2019 12:34 PM UTC

Hi Spotty, 

Thanks for the update. 

We are able to reproduce the reported problem, we have sent this to our development team to validate and we will update you the details on 2 April 2019. 

We appreciate your patience until then. 

Arulraj A 

Deivaselvan Y [Syncfusion]
Replied On April 2, 2019 11:17 AM UTC

Hi Spotty,

Thank you for your patience.

You can resolve the reported issue by handling the below highlighted code in CustomRenderer.cs file on your application. Kindly try with this and let us know if this helps you. 

Protected Overrides Sub OnEditElementLostFocus(sender As Object, e As EventArgs) 
        MyBase.OnEditElementLostFocus(sender, e) 
        'To commit the cell value.  
        If Me.Grid.CurrentCell.IsModified Then 
        End If 
 End Sub 


Replied On April 2, 2019 12:53 PM UTC

Yes i put this in at your advice to deal with another issue which then resulted in consistent repro of same error.    I suspect that thwre are still ways to generate this error without this code in place.

Deivaselvan Y [Syncfusion]
Replied On April 3, 2019 09:51 AM UTC

Hi Spotty, 
Thanks for your update. 
We have tested your reported scenario in your provided sample with our suggested changes. There is no exception occurred as you reported. The sample is working fine as we expected. Here, we have attached our tested video demo. Please let us know, if we have missed anything from your test cases. It will be helpful us to investigate further. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon