title: Asp.Net GridView get current row on TemplateField
body: <p>I have a gridView binded to a data source, and I have a ButtonField as one of the columns in the grid to perform a custom action.</p>
  
  <p>When I use the ButtonField, the CommandArgument of the event raised by it has the zero-based index of the row containing the clicked ButtonField.</p>
  
  <p>I want to convert the ButtonField to a TemplateField so I can add a control to the Footer of the column, the problem is that when I convert it to a TemplateField, the CommandArgument no longer has the row index.</p>
  
  <p>Is there a way to get such index on a TemplateField?</p>
  
  <p>I cannot use the gridView.SelectedIndex because the button can be clicked on a row that isn't the selected one.</p>
  
  <p>Thanks for your help</p>