Copy & Paste from RadGridView

10 posts, 0 answers
  1. Suman Rao
    Suman Rao avatar
    16 posts
    Member since:
    Aug 2009

    Posted 09 Aug 2010 Link to this post

    Hi All,

     Copy & Paste

     

    Is there any way to copy and paste like multiple rows and paste directly into excel as opposed to having to use the Export opion in RadGridView
    As the RadGridView Export always insists on the user saving the file first as this can be sometime quite cumbersome?

    Thanks and regards,
    Suman

  2. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 09 Aug 2010 Link to this post

    Hello Suman Rao,

     All you need to do is set the SelectionMode property on RadGridView to Multiple or Extended, in order to achieve multiple row selectio, press CTRL + C and that's all. RadGridView has robust Clipboard integration, which allows you to copy and/or paste cell or entire rows.

    Best wishes,
    Yavor Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Suman Rao
    Suman Rao avatar
    16 posts
    Member since:
    Aug 2009

    Posted 10 Aug 2010 Link to this post

    Thanks Yavor,

    I was able to copy and paste the entire row, but I am unable to select, copy the GridHeader
    How do we copy the Grid Header (Entire header row) ?

    Thanks and regards,
    Suman
  5. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 10 Aug 2010 Link to this post

    Hello Suman Rao,

     You need to include the GridViewClipboardCopyMode.Header flag in the ClipboardCopyMode property of RadGridView. You can set it like so "<telerik:RadGridView .... ClipboardCopyMode="Cells,Header"/>" in XAML or like so "radGridView1.ClipboardCopyMode = GridViewClipboardCopyMode.Cells | GridViewClibpoardCopyMode.Header;" in code-behind.

    When this flag is present, RadGridView will also include the column header for any selected cells.

    All the best,
    Yavor Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Joseph Gershgorin
    Joseph Gershgorin avatar
    28 posts
    Member since:
    Aug 2009

    Posted 22 Oct 2010 Link to this post

    Is it possible to initiate a copy via a method on the RadGridView control instead of ctrl-c/ctrl-v. I want to have a context menu for copy / paste on a RadGridView.
  7. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 25 Oct 2010 Link to this post

    Hello Joseph Gershgorin,

     You can use RadGridViewCommands.Copy and RadGridViewCommands.Paste, which are routed UI commands that we ship with RadGridView. You can see an example of the different RadGridViewCommands being used here.

    Best wishes,
    Yavor Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 06 Jun 2013 Link to this post

    I'm in need of this but I don't understand based on what I saw on your demo to implement it using the ContextMenu so the user can just copy an existing row which will produce a duplicate of this row.
  9. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 07 Jun 2013 Link to this post

    Hello Mark,

    Could you clarify what exactly you want to accomplish ? Do you want to copy a row and paste it to multiple other selected rows ? Or you want to insert a new row on pasting ?   

    Regards,
    Maya
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  10. Marc Roussel
    Marc Roussel avatar
    429 posts
    Member since:
    Dec 2009

    Posted 07 Jun 2013 Link to this post

    It's ok I found my solution.

    I just do a deep clone of DataContext object for the selected row and add the copy to the collection and issue a Grid.Rebind and do a SelectedItem = to the new object also a CurrentItem = to the new object and it works fine
  11. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 07 Jun 2013 Link to this post

    Hi Marc,

    Ok, great. Let me know if you need further assistance. 


    Regards,
    Maya
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
DevCraft banner