protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label lblqy = (Label)e.Row.FindControl("lblqty");
int qty = Int32.Parse(lblqy.Text );
total = total + qty;
}
if (e.Row.RowType == DataControlRowType.Footer)
{
Label lblTotalqty = (Label)e.Row.FindControl("lblTotalqty");
lblTotalqty.Text = total.ToString();
}
}
More Info :
GridView Total on Footer
Walsh.