Get GridView row index from a template field button
<p>first question:</p>

<p>I have a gridview 'gvSnacks' with a list of snacks and prices. The first column of the gridview is a templatefield with the button 'btnAdd'.</p>

<p>When one of the add buttons is clicked I want it to assign that rows value to an integer so I can retrieve additional data from that row.</p>

<p>This is what I have, but I've hit a dead end.</p>

<pre><code>protected void btnAdd_Click(object sender, EventArgs e)
{
    int intRow = gvSnacks.SelectedRow.RowIndex;

    string strDescription = gvSnacks.Rows[intRow].Cells[2].Text;
    string strPrice = gvSnacks.Rows[intRow].Cells[3].Text;
}
</code></pre>

<p>Appreciate any help!</p>
