I made a transfer for each cell, everything works fine and I thought about it .... is it possible to cycle? but it is necessary that line 4.5 with dvg1 is entered in column 4. An example of how I did is shown below.

dataGridView2.Rows[0].Cells[1].Value = Convert.ToString(dataGridView1.Rows[0].Cells[3].Value); dataGridView2.Rows[1].Cells[1].Value = Convert.ToString(dataGridView1.Rows[1].Cells[3].Value); dataGridView2.Rows[0].Cells[2].Value = Convert.ToString(dataGridView1.Rows[2].Cells[3].Value); dataGridView2.Rows[1].Cells[2].Value = Convert.ToString(dataGridView1.Rows[3].Cells[3].Value); dataGridView2.Rows[0].Cells[4].Value = Convert.ToString(dataGridView1.Rows[4].Cells[3].Value); dataGridView2.Rows[1].Cells[4].Value = Convert.ToString(dataGridView1.Rows[5].Cells[3].Value); dataGridView2.Rows[0].Cells[3].Value = Convert.ToString(dataGridView1.Rows[6].Cells[3].Value); dataGridView2.Rows[1].Cells[3].Value = Convert.ToString(dataGridView1.Rows[7].Cells[3].Value); 

    1 answer 1

     for (int i = 0; i < 8; i++) { int col = i / 2 + 1; col = col == 3 ? 4 : (col == 4 ? 3 : col); dataGridView2.Rows[i % 2].Cells[col].Value = Convert.ToString(dataGridView1.Rows[i].Cells[3].Value); }