Can't load the textbox inside the constructor
<p>I have a form called <code>SelectCatagoryId</code> which contains a <code>DataGridView</code>. I want to pass the selected <code>cellvalue</code>  from here to another form called <code>Add_product</code>.</p>

<p>This is the code inside the button event in <code>SelectcatagoryId</code>.</p>

<pre><code>private void dataGridView1_MouseClick(object sender, MouseEventArgs e)
{
    String dgv;
    dgv = dataGridView1.CurrentCell.Value.ToString();
    Add_product ap = new Add_product(dgv);
    this.Close();
}
</code></pre>

<p>This is the code inside <code>Add_product</code> form</p>

<pre><code>namespace Supermarket
{
    public partial class Add_product : Form
    {

        public Add_product()
        {
            InitializeComponent();
        }

        SqlConnection con;
        string file;

        public Add_product(String datagridvalue)
        {
            // MessageBox.Show(datagridvalue);
            textBox10.Text = Convert.ToString(datagridvalue);
        }
</code></pre>

<p><code>MessageBox</code> is working correctly,value of dgv in form <code>selectCatagoryId</code> is passed correctly to form <code>Add_product</code>, but I can't assign the value of variable <code>datagridvalue</code> to <code>textBox10.Text</code>.</p>
