Here is Example to total in footer............
protected void grdGuestTotal_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType.Equals(DataControlRowType.Footer))
{
Label NetSubTotal = ((Label)e.Row.FindControl("lblNetSubTotal"));
Label FinalTotal = ((Label)e.Row.FindControl("lblTotal"));
NetSubTotal.Text = Total.ToString();
FinalTotal.Text = EndTotal.ToString();
}
if (e.Row.RowType.Equals(DataControlRowType.DataRow))
{
Label SubTotal = ((Label)e.Row.FindControl("lblSubTotal"));
Label NetTotal = ((Label)e.Row.FindControl("lblNetTotal"));
double value = Convert.ToDouble(SubTotal.Text);
Total += value;
double amount = Convert.ToDouble(NetTotal.Text);
EndTotal += amount;
}
}
[EDIT]CODE tags added - LOSMAC[/EDIT]