summary of the gridview

emmaaax3

New Member
I need gridview summary on footer...\[code\] protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { decimal totalPrice = 0M; int totalItems = 0; if (e.Row.RowType == DataControlRowType.DataRow) { Label lblPrice = (Label)e.Row.FindControl("lblPrice"); decimal price = Decimal.Parse(lblPrice.Text); totalPrice += price; totalItems += 1; } if (e.Row.RowType == DataControlRowType.Footer) { Label lblTotalPrice = (Label)e.Row.FindControl("lblTotalPrice"); lblTotalPrice.Text = totalPrice.ToString(); } }\[/code\]But its not working. Any ideas?
 
Back
Top