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

[Solved] Pasting formatted text from Excel

3 Answers 136 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Bhaskar Khaund
Top achievements
Rank 1
Bhaskar Khaund asked on 14 Dec 2010, 12:40 PM
Formatted Text when pasted onto Grid comes with additional double quotes ("") surrounding it. Why is that so? I tried pasting following data from excel to grid.

237 Customer 4579 70 16-Sep-21
3259 Customer 1614 42 12-Mar-17
9588 Customer 4777 81 08-Oct-37
4099 This
is
a
<Formatted>
Text.
45 08-May-16

It appeared on grid like this:

237 Customer 4579 70 16 Sep 2021
3259 Customer 1614 42 12 Mar 2017
9588 Customer 4777 81 08 Oct 1937
4099 "This
is
a
<Formatted>
Text." 45 08 May 2016

3 Answers, 1 is accepted

Sort by
0
Yavor Georgiev
Telerik team
answered on 14 Dec 2010, 12:46 PM
Hello Bhaskar Khaund,

 Due to the limited Clipboard support in Silverlight, we are forced to parse plain text and have no access to the advanced Excel features. You can handle the PastingCellClipboardContent event to try and modify the incoming value for the cell.

Best wishes,
Yavor Georgiev
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Bhaskar Khaund
Top achievements
Rank 1
answered on 29 Dec 2010, 10:13 PM
I tried handelling the text in PastinCellClipboardContent event, but there is no way to identify whether the text actually contains quotes or the quotes are additionally added by the grid...There is no consistant behaviour with respect to having additional quotes surrounding the formatted text. Why is that so?

And i am using GridView for WPF as well, same problem persist there. Similar to silverlight, is there only limited clipboard support in WPF? I will post the same question in the WPF's Grid View forum to know the details.
0
Yavor Georgiev
Telerik team
answered on 30 Dec 2010, 01:50 PM
Hi Bhaskar Khaund,

 RadGridView shares the same codebase for Silverlight and WPF. Even though WPF provides vastly more powerful clipboard support, we are still bound to the Silverlight limitations.

 However, RadGridView does not insert any content into the clipboard prior to pasting (for ex. double quotes). It is likely that those quotes are the from the source. What you can do is to inspect the contents of the 'Unicode Text' clipboard format after copying from Excel to see if the quotes are there or not.

Greetings,
Yavor Georgiev
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
GridView
Asked by
Bhaskar Khaund
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Bhaskar Khaund
Top achievements
Rank 1
Share this question
or