public void kraGridView_RowDataBound(object sender, GridViewRowEventArgs e)
int totalPercent = 0;
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lblWeigh = (Label)e.Row.FindControl("lblWeigh");
// totalPercent += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "lblWeigh"));
int total = int.Parse(lblWeigh.Text);
totalPercent += total;
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
Label lblTotalPercentage = (Label)e.Row.FindControl("lblTotalPercentage");
// e.Row.Cells[5].Text = totalPercent.ToString();
lblTotalPercentage.Text = totalPercent.ToString();
}
}
japhta
0
Newbie Poster
Recommended Answers
Jump to PostCan you elaborate a bit more on what you need help with? Do you have a specific question, or is there an error you are having a problem with?
Jump to PostThis MSDN Article/Tutorial explains how to build a gridview with a footer that includes summary/calculations. Exactly what you are trying to do.
Displaying Summary Information in the GridView's Footer
Is this the article …
All 6 Replies
JorgeM
958
Problem Solver
Team Colleague
Featured Poster
japhta
0
Newbie Poster
japhta
0
Newbie Poster
JorgeM
958
Problem Solver
Team Colleague
Featured Poster
japhta
0
Newbie Poster
japhta
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.