To
Copy
the contents of the
current cell
(click on a cell arrow navigate to a cell using arrow keys to make it a current) the
KeyDown
event of the
DataGridView
can be handled as shown below and the contents can be copied upto to the last cell in the current row when
Ctrl+Enter
is pressed.
dataGridView1.KeyDown += (sender, args) => {
if (!args.Control || args.KeyCode != Keys.Enter)
return;
var currentVal = dataGridView1.CurrentCell.Value;
for(int i=dataGridView1.CurrentCell.ColumnIndex; i<dataGridView1.Columns.Count; i++){
dataGridView1.CurrentRow.Cells[i].Value=currentVal;
}
};