Copying from Excel to Radgrid view

2 posts, 0 answers
  1. Manish
    Manish avatar
    1 posts
    Member since:
    Apr 2012

    Posted 20 Feb Link to this post

    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

     

  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    444 posts

    Posted 23 Feb Link to this post

    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 allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top