Hi! I created a Cash Book webform application in C#. In the columns Debit, Credit and Balance, I want to get the running balance from Debit and Credit columns.
I'm using a TemplateField. Here's what I started but still no luck. Hope someone can help me.- protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- DataRowView dtview = e.Row.DataItem as DataRowView;
- if (e.Row.RowType == DataControlRowType.DataRow)
- {
- Label Debit = (Label)e.Row.FindControl("lblDebit");
- GetDebit += GetDebit + Convert.ToDecimal(Debit.Text);
- Label Credit = (Label)e.Row.FindControl("lblCredit");
- GetCredit += GetCredit + Convert.ToDecimal(Credit.Text);
- Label Balance = (Label)e.Row.FindControl("lblBalanceForwared");
- GetBalance += GetBalance + Convert.ToDecimal(Balance.Text) + GetBalance- GetCredit;
- }
- }

Jes SiePosted Nov 2, 2016, 4:24 AM
Santhakumar MunuswamyPosted Oct 19, 2016, 5:22 AM