There's a built-in support for Copy and Paste in the DataGridViewTextBoxEditingControl (Well, it's basically a TextBox). So even if you don't code, the default [Ctrl]+[C], [Ctrl]+[X], and [Ctrl]+[V] will work just fine. You just need to enter edit mode of the cell, select a piece of text, press the [Ctrl]+[C], then go to another cell, enter edit mode, select something or click in middle of the text, press [Ctrl]+[V] and it works as expected.
But if for some reason, you would like to have some ToolStipButton
for copy/paste, you can just add a ToolStrip, having some buttons, handle click event like this:
private void toolStripButtonCopy_Click(object sender, EventArgs e)
{
var txt = dataGridView1.EditingControl as TextBox;
if (txt != null)
{
txt.Copy();
}
}
private void toolStripButtonPaste_Click(object sender, EventArgs e)
{
var txt = dataGridView1.EditingControl as TextBox;
if (txt != null)
{
txt.Paste();
}
}
Please keep in mind, Button will not work in this case, because it steals the focus and the DataGridView.EditingControl will disappear.