title: how to show value of datagridview in textbox C#
body: <p>i have written the following codes but it shows the previous records in text boxes. </p>
  
  <pre><code>private void dataGridViewkala_KeyDown(object sender, KeyEventArgs e)
          {
              txtkalacode.Text = dataGridViewkala.CurrentRow.Cells[0].Value.ToString();
             txtkalaname.Text = dataGridViewkala.CurrentRow.Cells[1].Value.ToString();
              txtkqty.Text = dataGridViewkala.CurrentRow.Cells[2].Value.ToString();
              txtkalapoint.Text = dataGridViewkala.CurrentRow.Cells[3].Value.ToString();}
  </code></pre>
  
  <p>what is wrong in my codes, i try these codes too,</p>
  
  <pre><code>txtkalapoint.Text=dataGridViewkala.SelectedRows[0].Cells[3].Value.ToString();
  </code></pre>
  
  <p>when i press the arrow key in text boxes,it shows the previous records.</p>