DataGridCutPasteHandler Process Method CleanCode C# Libraries v1.2.03 API
Process cut, copy, and paste keystrokes at the cell-focus level.

Namespace: CleanCode.Forms
Assembly: CleanCode (in CleanCode.dll) Version: 1.2.3.0 (1.2.03)
Syntax

public static bool Process(
	DataGridView dataGridView,
	KeyEventArgs e
)

Return Value

A boolean indicating whether a new row was added on a paste.
Remarks

To use this method, simply hook it up to the KeyDown event handler of each OnlineDataGridView you wish to instrument. Examples:
private void cmdDataGridView_KeyDown(object sender, KeyEventArgs e)
{
    if (DataGridCutPasteHandler.Process((DataGridView)sender, e))
    {
        // new row added by paste... do something here...
    }
}

private void otherDataGridView_KeyDown(object sender, KeyEventArgs e)
{
    DataGridCutPasteHandler.Process((DataGridView)sender, e);
}
This method will check to see if any of the three standard keys Control+C (copy), Control+V (paste), and Control+X (cut) have been pressed and if so, take the appropriate action. Control+Shift+V is also supported to duplicate a selected row as a new row at the bottom. The first example demonstrates using the return value to take appropriate action when the paste operation results in a new row.
See Also