title: Show the selected row record in textbox/label
body: <p>How do I make the selected row record from a <code>DataGridView</code> show in a <code>TextBox</code>? I got some <code>TextBox</code> and <code>Label</code> in a <code>Form</code>. I want the text inside the <code>TextBox/Label</code> to change when the user selects a row record from the <code>DataGridView</code>. I tried the following code to make it happen, but it doesn't work</p>
  
  <pre><code>private void ItemTable_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
  {
      label_itemid_show.Text = ItemTable.Rows[e.RowIndex].Cells[0].Value.ToString();
      text_itemname.Text = ItemTable.Rows[e.RowIndex].Cells[1].Value.ToString();
      text_itemprice.Text = ItemTable.Rows[e.RowIndex].Cells[2].Value.ToString();
      text_itemstock.Text = ItemTable.Rows[e.RowIndex].Cells[3].Value.ToString();
  }
  </code></pre>