Completed
Last Updated: 22 Jul 2019 13:44 by ADMIN
Ruben
Created on: 15 Feb 2017 10:06
Category: Spreadsheet
Type: Feature Request
57
Configure Kendo Spreadsheet to paste values only (keeping cell configuration)
I know that Kendo Spreadsheet works like most popular Spreadsheets (Excel and Google Spreadsheet) where, if you copy or drag and paste values from cells, you will copy also the styles, validations, etc from that cell to the new one (unless you select "paste values only" in a context menu or ctrl + shift + v). 

It would be awesome if we can set how this works by configuring a property in the Spreadsheet configuration, something like pasteValuesOnly: false/true or even more complex with an object where you can choose if paste values, validations, formulas, styles or whatever. Also you could attach this functionalities to a context menu (as Google Spreadsheet does) and be able to paste everything, values only, format only, formulas or data validation.
9 comments
ADMIN
Nencho
Posted on: 27 Jun 2019 10:37
Hello all,

With the recently implemented paste event, we provide the ability to achieve this feature request. We've created a KB article, demonstrating the implementation and how to paste only the values:

https://docs.telerik.com/kendo-ui/knowledge-base/spreadsheet-paste-only-values

Regards,
Nencho
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Maxwell
Posted on: 26 Oct 2018 15:56
I would also like this future now that the workaround doesn't work in the latest version
nicole
Posted on: 02 Feb 2018 19:01
Hello! Thanks for the workaround! works perfectly

I was able to keep the validation as well, but I can't get it to trigger and show the popup error. 
Is there any way I can achieve this? 

thanks!
Marc
Posted on: 15 Sep 2017 07:53
This is my workaround - it retains the original cells formatting (the formats that we use anyways, not all possible formats are listed)

kendo.spreadsheet.Clipboard.prototype.paste = function () {
                        var sheet = this.workbook.activeSheet();
                        var pasteRef = this.pasteRef();
                        var content = this._content;

                        var currBackground = sheet.range(pasteRef).background();
                        var currColor = sheet.range(pasteRef).color();
                        var currFontSize = sheet.range(pasteRef).fontSize();
                        var currFontFamily = sheet.range(pasteRef).fontFamily();
                        var currTextAlign = sheet.range(pasteRef).textAlign();

                        var currEnable = sheet.range(pasteRef).enable();
                        var currItalic = sheet.range(pasteRef).italic();

                        sheet.range(pasteRef).setState(content, this);
                        sheet.triggerChange({ recalc: true, ref: pasteRef });

                        sheet.range(pasteRef)
                            .background(currBackground)
                            .color(currColor)
                            .bold(true)
                            .enable(currEnable)
                            .italic(currItalic)
                            .fontSize(currFontSize)
                            .fontFamily(currFontFamily)
                            .textAlign(currTextAlign);
                    };
ADMIN
Joana
Posted on: 21 Jul 2017 06:53
Have a look at the following dojo which shows an example how to strip styles, validation, formulas on paste: http://dojo.telerik.com/@jivanova/oCACe 
Josué
Posted on: 15 Jun 2017 16:52
At least give us a workarround...
It is so inconfortabe not being able to use the paste and lost the validations
Jesus
Posted on: 15 Jun 2017 16:48
Absolutelly needed, I have a big problem when I use dates because if I paste on it a date, the validation is gone. User is forced to type on it and dont use the paste, that is not good for user experience, paste only values as excel does should be so helpfull
Mikko
Posted on: 05 Apr 2017 06:04
This would be very highly appreciated. We noticed that pasting data from Excel into Kendo Spreadsheet is extremely slow because Kendo wants to paste the styles too. Pasting e.g. 200 rows and 1 column takes 4-5 seconds, but the more columns you have the longer it takes - exponentially longer. With 3 or more columns it freezes the browser completely. We made a patch in our app that removes the HTML from the pasted data and this makes pasting this amount of data already possible (no hanging anymore), but it is still slow (30 seconds). Further removing Kendo's strange desire to reset row heights for pasted data makes pasting very fast, but we have not found a way to only disable this feature when pasting data.

Allowing devs to control the pasting behaviour would be fantastic.
Imported User
Posted on: 24 Mar 2017 07:01
Excel lets you copy values only via it's paste menu, which will prevent overwriting the validations/format. Kendo Spreadsheet at a minimum needs to give the dev control over paste operations.