C#: Capturing values in datagridview not working properly
<p>I'm having a bit of a problem with getting values from DataGridView in C#.</p>

<p>I'm currently using this code for example:</p>

<pre><code>private void GridView_Discount_CellContentClick(object sender, DataGridViewCellEventArgs e)
    {
        Label_DiscountID.Text = GridView_Discount.Rows[e.RowIndex].Cells[0].Value.ToString();
        Field_DiscountName.Text = GridView_Discount.Rows[e.RowIndex].Cells[1].Value.ToString();
        Field_DiscountRate.Text = GridView_Discount.Rows[e.RowIndex].Cells[2].Value.ToString();
    }
</code></pre>

<p>...and it actually works.</p>

<p>However, it only works when I click the part of the cell with value in it, but when I click on the part of the cell which is a white space, it doesn't capture the data. I am resizing the cells so it would fit the DataGridView component.</p>

<p>Also, I made the <code>SelectionMode</code> to <code>FullRowSelect</code>, so once I click one of the cells, it selects the full row, but still, it won't work when I click on the white spaces.</p>

<p>Any idea?</p>
