Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
RunningBalance in Columns of Gridview in ASP.NET Webforms C#
Hold On
Oct 19 2016 4:45 AM
422
Reply
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;
}
}
Another thing, I am just a neophyte in programming. Thanks in advance.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
Under Same Solution Upload Picture Different Project Img Pat
WebForms UnobtrusiveValidationMode requires a ScriptResource