Copy current cell content

4 posts, 0 answers
  1. Leandro
    Leandro avatar
    48 posts
    Member since:
    Jul 2015

    Posted 11 Sep 2018 Link to this post

    Hey guys, after I've updated telerik, Ctrl+C command copy all row content, I want it to copy only Current cell content with SelectionMode = GridViewSelectionMode.FullRowSelect. Is there anyway to achive that?
  2. Leandro
    Leandro avatar
    48 posts
    Member since:
    Jul 2015

    Posted 19 Sep 2018 Link to this post

    no way?
  3. Sebastian
    Sebastian avatar
    4 posts
    Member since:
    Dec 2013

    Posted 09 Nov 2018 Link to this post

    I have the same problem. Anyone knows how to solve it?
  4. Dimitar
    Admin
    Dimitar avatar
    2892 posts

    Posted 09 Nov 2018 Link to this post

    Hi,

    You can use the Copying event and set the clipboard content:
    private void RadGridView1_Copying(object sender, GridViewClipboardEventArgs e)
    {
        e.Cancel = true;
        var text = radGridView1.CurrentCell.Value.ToString();
        DataObject dataObject = e.DataObject;
        dataObject.SetData(DataFormats.Text, false, text);
      
    }

    I hope this will be useful.  

    Regards,
    Dimitar
    Progress Telerik
    Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top