Cannot display Sum of column in Gridview
<p>I am not able to display the Value in a lable in footer. Below is the code </p>

<pre><code>Aspx

&lt;asp:GridView ID="gvallAccount" runat="server" AutoGenerateColumns="False" Width="589px"
                        OnRowDataBound="gvallAccount_RowDataBound" OnRowCommand="gvallAccount_RowCommand"&gt;
                        &lt;Columns&gt;
                            &lt;asp:TemplateField Visible="False"&gt;
                                &lt;ItemTemplate&gt;
                                    &lt;asp:Label ID="lblAccountID" runat="server" Text='&lt;%# Bind("ProductAccountID") %&gt;'&gt;&lt;/asp:Label&gt;
                                &lt;/ItemTemplate&gt;
                            &lt;/asp:TemplateField&gt;
                            &lt;asp:TemplateField HeaderText="Name" Visible="True"&gt;
                                &lt;ItemTemplate&gt;
                                    &lt;asp:Label ID="lblProductName" runat="server" Text='&lt;%# Bind("ProductName") %&gt;'&gt;&lt;/asp:Label&gt;
                                &lt;/ItemTemplate&gt;
                            &lt;/asp:TemplateField&gt;
                            &lt;asp:TemplateField HeaderText="Account Number" Visible="True"&gt;
                                &lt;ItemTemplate&gt;
                                    &lt;asp:LinkButton ID="lnkAccCode" runat="server" Text='&lt;%# Bind("ProductAccountCode") %&gt;'
                                        OnClick="lnkAccCode_Click" CommandName="gotoLink"&gt;&lt;/asp:LinkButton&gt;
                                &lt;/ItemTemplate&gt;
                            &lt;/asp:TemplateField&gt;
                            &lt;asp:TemplateField HeaderText="Account Value(KES)" Visible="True"&gt;
                                &lt;ItemTemplate&gt;
                                    &lt;asp:Label ID="lblBalance" runat="server" Text='&lt;%# Bind("BalanceToDate") %&gt;'&gt;&lt;/asp:Label&gt;
                                &lt;/ItemTemplate&gt;
                                &lt;FooterTemplate&gt;
                                    &lt;asp:Label ID="lblTotal" runat="server"&gt;&lt;/asp:Label&gt;
                                &lt;/FooterTemplate&gt;
                            &lt;/asp:TemplateField&gt;
                        &lt;/Columns&gt;
                    &lt;/asp:GridView&gt;

C# Code 

 protected void gvallAccount_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        try
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                decimal rowTotal = Convert.ToDecimal
                            (DataBinder.Eval(e.Row.DataItem, "BalanceToDate"));
                grdTotal = grdTotal + rowTotal;
            }
            if (e.Row.RowType == DataControlRowType.Footer)
            {
                Label lblTotal = (Label)e.Row.FindControl("lblTotal");
                lblTotal.Text = grdTotal.ToString();
            }
        }
        catch (Exception Ex)
        {
            logger.Error("gvallAccount_RowDataBound : " + Ex.Message);
        }
    }
</code></pre>
