title: Getting value from a cell from a gridview on RowDataBound event
body: <pre><code>string percentage = e.Row.Cells[7].Text;
  </code></pre>
  
  <p>I am trying to do some dynamic stuff with my GridView, so I have wired up some code to the RowDataBound event. I am trying to get the value from a particular cell, which is a TemplateField. But the code above always seems to be returning an empty string. </p>
  
  <p>Any ideas?</p>
  
  <p>To clarify, here is a bit the offending cell:</p>
  
  <pre><code>&lt;asp:TemplateField HeaderText="# Percentage click throughs"&gt;
  &lt;ItemTemplate&gt;
      &lt;%# AddPercentClickThroughs((int)Eval("EmailSummary.pLinksClicked"), (int)Eval("NumberOfSends")) %&gt;
  &lt;/ItemTemplate&gt;
  &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>On a related note, does anyone know if there is a better way of selecting the cell in the row. It sucks putting in <code>cell[1]</code>. Couldn't I do <code>cell["mycellname"]</code>, so if I decide to change the order of my cells, bugs wont appear?</p>