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

Copying from Excel to Radgrid view

1 Answer 260 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Manish
Top achievements
Rank 1
Manish asked on 20 Feb 2017, 10:18 AM

Dear Forum Members ,

 

I have a requirement to copy paste the Excel content to Radgrid view , Here few of the columns of the grid are Read only , i tried out the Below options , Any suggestions appreciated .

In Rad gridview is set the below properties

ClipboardCopyMode="Cells" ClipboardPasteMode="AllSelectedCells,Cells" SelectionMode="Extended" SelectionUnit="Cell"

 

and in the behaviour have the PastingCellClipboardContent event to check on the data and map it accordingly , issue here is that for read-only columns this is not fired , please do suggest

 

regards
Anand

 

1 Answer, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 23 Feb 2017, 07:35 AM
Hi Anand,

Such behavior would be expected when the columns are Read Only.  However, you can utilize the Pasting/Pasted events to achieve your requirement. When the Pasting event is fired, make all columns in the RadGridView writeable so that you can paste the new content and when the Pasted event fires you can switch them back to read-only. I have attached a sample for your reference. Of course, you will need to apply some additional logic but the approach should be viable.

Regards,
Stefan Nenchev
Telerik by Progress
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 you to write beautiful native mobile apps using a single shared C# codebase.
Tags
General Discussions
Asked by
Manish
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Share this question
or