DataGridView copy to clipboard

2016/04/19 17:43


           

To copy the content of DataGridView cells to clipboard using MouseClick function

private void DataGridView1_MouseClick(object sender, MouseEventArgs e)

{

DataGridView1.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;

DataGridView1.SelectAll();

Clipboard.SetDataObject(DataGridView1.GetClipboardContent());

}