title: Copy a datagridview cell value to another cell in the same datagridview automatically
body: <p>In my datagridview, i got 4 columns, when the user gives some value to the first row then I want to take the <code>1st row 4th cell value and put it to the 2nd Row 3rd cell</code>like that I have to apply for all the rows(Please see the image ). In some case I'll have only 2 rows and the max i'll have 4 rows.</p>
  
  <p>The below method it works, but when i tested with 2 or 3 rows it doesn't work..obviously 3rd and 4th is doesn't exist.</p>
  
  <p>What should i do?? Is there a better way of doing this?? </p>
  
  <p>Here i coded for the max 4 rows.</p>
  
  <pre><code>private void dataGridView1_CellLeave(object sender, DataGridViewCellEventArgs e)
          {
               var value1 = dataGridView1.Rows[0].Cells[3].Value.ToString();
              dataGridView1.Rows[1].Cells[2].Value = value1;
  
              var value2 = dataGridView1.Rows[1].Cells[3].Value.ToString();
              dataGridView1.Rows[2].Cells[2].Value = value2;
  
              var value3 = dataGridView1.Rows[2].Cells[3].Value.ToString();
              dataGridView1.Rows[3].Cells[2].Value = value3;
          }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/HhcQK.jpg" alt="enter image description here"></p>