title: GridView footer not working
body: <p>I want to display a total in the GridView footer - nothing unusual there. I've followed the example on the Microsoft website, but it's not working:</p>
  
  <pre><code>&lt;asp:GridView ID="gvTimeOverview" DataSourceID="sdsTimeOverview" AutoGenerateColumns="false" ShowFooter="true" CssClass="gridview" runat="server"&gt;
              &lt;Columns&gt;
                  &lt;asp:BoundField DataField="DateTimeAdded" HeaderText="Date" DataFormatString="{0:dd/MM/yyyy}" /&gt;
                  &lt;asp:BoundField DataField="DateTimeAdded" HeaderText="Time" DataFormatString="{0:HH:mm}" /&gt;
                  &lt;asp:BoundField DataField="TimeToAdd" HeaderText="Mins Allocated" /&gt;
              &lt;/Columns&gt;    
          &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>protected void gvTimeOverview_RowDataBound(object sender, GridViewRowEventArgs e)
  {
      if (e.Row.RowType == DataControlRowType.DataRow)
      {
          totalMins += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "TimeToAdd"));
      }
      else if (e.Row.RowType == DataControlRowType.Footer)
      {
          e.Row.Cells[0].Text = "Totals:";
          e.Row.Cells[1].Text = totalMins.ToString();
          e.Row.ForeColor = Color.Black;
      }
  }
  </code></pre>
  
  <p>Any idea why?</p>