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

Copy data without format

1 Answer 109 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Magnus
Top achievements
Rank 1
Magnus asked on 03 Jul 2017, 05:55 AM

Is there a way to copy/export the data in a GridView without applying DataFormatString? We have custom formatting on some values and when pasting the values in Excel it's not able to parse them correctly.

I guess that the issue lies in Excel, but a value that is displayed in the RadGridView as "2 250,00" (DataFormatString = "N2", Swedish culture) is parsed as a String when pasted to Excel, and it's impossible to apply any other format until I remove the thousand separator (even when Excel is using a format with a thousand separator).

We're currently copying to the clipboard in Html-format, because some cells contains text with linebreaks, and this seems to be the only way to keep them without breaking the rows.

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 05 Jul 2017, 11:35 AM
Hello Magnus,

You can handle the CopyingCellClipboardContent event in order to override the value to be copied to the clipboard.

Similarly, you can use the exporting events to handle this process when exporting.

I hope you find these resources helpful.

Regards,
Dilyan Traykov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Magnus
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or