dataGridView_CellContentClick: Invoke or BeginInvoke cannot be called on a control
<p>Can any one show me what did i do wrong this code, it produce msg </p>

<p>“Invoke or BeginInvoke cannot be called on a control until the window handle has been created.”</p>

<pre><code>private void dataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

                if (e.ColumnIndex == buyColumn.Index)
                {

                    double openprice = (double)dataGridView.Rows[e.RowIndex].Cells[offerColumn.Index].Value;
                    string symbol = dataGridView.Rows[e.RowIndex].Cells[symbolColumn.Index].Value.ToString();
                    double quanity= (double)dataGridView.Rows[e.RowIndex].Cells[quanityColumn.Index].Value;

                    MessageBox.Show("I buy " + symbol +  " with "  + quanity + " at " + openprice);
            }        
</code></pre>

<p>Update: after debug , these 3 lines cause the issues , plz show me how to fix</p>

<pre><code>double openprice = (double)dataGridView.Rows[e.RowIndex].Cells[offerColumn.Index].Value;
                        string symbol = dataGridView.Rows[e.RowIndex].Cells[symbolColumn.Index].Value.ToString();
                        double quanity= (double)dataGridView.Rows[e.RowIndex].Cells[quanityColumn.Index].Value;
</code></pre>
