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

Copy current cell content

3 Answers 50 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Leandro
Top achievements
Rank 1
Leandro asked on 11 Sep 2018, 03:24 PM
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?

3 Answers, 1 is accepted

Sort by
0
Leandro
Top achievements
Rank 1
answered on 19 Sep 2018, 01:43 PM
no way?
0
Sebastian
Top achievements
Rank 1
answered on 09 Nov 2018, 01:35 PM
I have the same problem. Anyone knows how to solve it?
0
Dimitar
Telerik team
answered on 09 Nov 2018, 01:52 PM
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.
Tags
GridView
Asked by
Leandro
Top achievements
Rank 1
Answers by
Leandro
Top achievements
Rank 1
Sebastian
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or