When doing a copy / paste of numeric values from excel to RadSpreadsheet initial zero values are lost. So, when I copy for example value 07657656 it gets pasted as 7657656.
Is there any workaround this behavior?
2 Answers, 1 is accepted
0
Accepted
Peter Milchev
Telerik team
answered on 03 Apr 2020, 09:54 AM
Hello Giorgos,
One option is to set the format of a given range to text.
Another option is to set the format of the pasted data as text using the OnClientPaste event of the Spreadsheet:
<telerik:RadSpreadsheetrunat="server"ID="RadSpreadsheet1"OnClientPaste="OnClientPaste"></telerik:RadSpreadsheet><script>functionOnClientPaste(sender, args) {
var clipboardData = args.get_clipboardContent().data;
for (var i = 0; i < clipboardData.length; i++) {
for (var j = 0; j < clipboardData[i].length; j++) {
var cellData = clipboardData[i][j];
cellData.format = "@";
}
}
}
</script>
Regards,
Peter Milchev
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.