when i try that code is give me a lot of errors i need something add a cumulative total column to my GridView that would show a cumulative total of one of the numeric columns in the row. like that Running / Cumulative total in GridView column i need exactly what solved here but code is not working
debit |credit |Total
2 | 0 | 2
0 | 1 | 3
-0.5 | 0 | 2.5
0 |1.5 |4
that my html
<asp:TemplateField HeaderText="amount">
<ItemTemplate>
<asp:Label runat="server" ID="lblTotal" Text=""></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="debit">
<ItemTemplate>
<asp:Label ID="debit" runat="server" Text='<%# (Eval("stat_flag").ToString() =="d" ) ? Eval("stat_amount"): "0.00" %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="credit">
<ItemTemplate>
<asp:Label ID="credit" runat="server" Text='<%# (Eval("stat_flag").ToString() =="c" ) ? Eval("stat_amount"): "0.00" %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
that my code with the error