title: display selected datagridview item to textbox on another form c#
body: <p>I am designing a pos system that require user to select product from list which is located on another form, the list is generated in datagridview. what I need now is when I click on the item on the datagridview list it should display in textbox on the pos form. I have the below code but it does not pass value to the form </p>
  
  <pre><code>private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
  {
      POS pos = new POS();
      pos.txtProductCode.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString();
      pos.txtProductName.Text = dataGridView1.CurrentRow.Cells[1].Value.ToString();
      this.Hide();
  }
  </code></pre>
  
  <p>thanks in advance.</p>