C# Windows Forms & ASP .NET MVC programming
Structured Query Language (SQL)
Smart Marine 3D Ship design
Tribon M3 / AVEVA Marine

DataGridView copy to clipboard

2012/10/19 09:15
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());
}