private void CopyRows(DataGridView DGVGrid, int SourceRowID, int DestinationRowID)
{
for (int j = 0; j < DGVGrid.Rows[SourceRowID].Cells.Count; j++)
DGVGrid.Rows[DestinationRowID].Cells[j].Value = DGVGrid.Rows[SourceRowID].Cells[j].Value;
}
// now call funcation
private cpyButton_Click(object sender, EventArgs e)
{
int myRowIndex = myGrid.CurrentRow.Index;
for (int count = 0; count < myGrid.Rows.Count; count++)
{
CopyRows(myGrid, myRowIndex, myRowIndex + 1);
}
}
//Now call the function CopyRows(DataGridView1, 0, 1); in order to copy Row at position 0 to Row at position 1. In order to copy multiple rows, call the function in a loop.
//this is only to copy from any rows of the grid to the next row.