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

Copy and Paste


I am working with the spreadsheet. When I copy  a cell or group of cells, the Paste function becomes enabled in the ribbon and the context menu.  I move to the cell I wish the paste to start in and click on paste (ribbon or context menu) and the data is copied as you would expect. I notice that the cell(s) I copied from have a broken border similar to selected cell(s) in Excel. I hit escape and it clears the broken border so you would assume that the clipboard has been cleared. But no, Paste is still enabled and if I use the paste feature again, it continues to paste the data from the previously selected cells.  Since the escape key only clears the broken border, how do I clear the previous selection (clipboard) and disable the Paste feature after I have finished my copy and paste? 

To see this in action go right to the example on this web site:
http://mvc.syncfusion.com/demos/web/spreadsheet/default

select and copy any cells
Paste the copied data to another cell or cells.
Hit escape to clear the selected cell(s).
Select an empty cell and click on paste again.

I am sure I missed something somewhere.

Thanks,
Jim Cox

5 Replies

SI Silambarasan I Syncfusion Team October 26, 2016 12:31 PM UTC

Hi Jim, 
 
Thank you for using Syncfusion products. 
 
We have checked the reported query and we would like to let you know that as per the web platform behaviour, we can’t able to access the clipboard from client-side to clear its content which is existing feature in Online MS Excel too.  
 
When you copy a cell or range of cells in Spreadsheet, we have copied the cells data to the clipboard and updating some internal properties for perform the paste action.  Once press the escape key after you pasted, we have clear the maintained internal properties alone.  However, the content in the clipboard will not be cleared.  
 
Please refer the below online MS Excel link, 
 
 
Regards, 
Silambarasan I 



UN Unknown Syncfusion Team October 26, 2016 01:33 PM UTC

Hi Silambarasan.

Thanks for your quick response.

I tried it using Excel On-Line and it does clear the selected value.

Open a spreadsheet using Excel On-Line.
Pick any cell and enter a value.
Copy that cell and the broken border appears.
Paste that value in another cell.
Click on Escape and the broken border disappears.
Go to another cell and click on Paste and nothing is pasted into that cell.

This is what I am looking for. On ejSpreadsheet, you can continue to paste the last selected value(s) even after it appears you have cleared the broken border by clicking escape.

Assuming what I want cannot be done at this time, is there a way to disable the Paste links through CSS or JS and still maintain it's ability to be enabled if I decide to copy other cells? I can capture the "paste" event so I know when it ends and would like to be able to disable Paste at that point.

Thanks,

Jim Cox


SI Silambarasan I Syncfusion Team October 27, 2016 11:38 AM UTC

Hi Jim, 
 
Thanks for your update. 
 
Query #1 “I tried it using Excel On-Line and it does clear the selected value.” 
 
We have checked the reported query and we can able to reproduce it in our end as per the following steps. 
 
1. In ejSpreadsheet, select any cell and click “Copy” option in (Ribbon or Context menu) by using mouse click and not using keyboard interaction (i.e. Ctrl + C). 
2. After pressing Escape key, the previous copied data get pasted by clicking “Paste” option in (Ribbon or Context menu) by using mouse click. But in online MS Excel, you could get an alert dialog when clicking paste button as like follows, 
 
 
 
 
Could you please confirm whether the above replication procedures are same as that you are facing in your end, so that it will be helpful for us to resolve your issue and proceed this further?  
 
 
Query #2 “Is there a way to disable the Paste links through CSS or JS and still maintain it's ability to be enabled if I decide to copy other cells? I can capture the "paste" event so I know when it ends and would like to be able to disable Paste at that point.” 
 
Your requirement for disable the Paste option in Ribbon can be achieved by using “XLRibbon.disableRibbonItems()” client-side method.  Please refer the following code example. 
 
 
$("#Spreadsheet").ejSpreadsheet({ 
    //... 
    actionComplete: function (args) { 
        //... 
            this.XLRibbon.disableRibbonItems([this._id + "_Ribbon_Home_Clipboard_Paste"]); 
    }, 
}); 
 
 
For your convenience, we have prepared a sample to demonstrate this in JS Playground.  Please refer the below sample link, 
 
 
 
Regards, 
Silambarasan I 



UN Unknown Syncfusion Team October 30, 2016 11:35 PM UTC

HI Silambarasan I.

Yes, that appears to be the issue.

Thanks,

Jim Cox


SI Silambarasan I Syncfusion Team October 31, 2016 11:29 AM UTC

Hi Jim, 
 
Thanks for your update. 
 
We considered this as a defect and a new support incident has been created under your account to track the status of this requirement.  Please log on to our support website to check for further updates.  
 
 
 
Regards, 
Silambarasan I 


Loader.
Live Chat Icon For mobile
Up arrow icon