int tohours, tomin;
protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Label thrs = (Label)e.FindControl("Overtime");
TimeSpan ts = TimeSpan.Parse(thrs.Text);
tohours += ts.Hours;
tomin += ts.Minutes;
}
if (e.Row.RowType == DataControlRowType.Footer)
{
Label fthrs = (Label)e.Row.FindControl("lblTotalhrs");
fthrs.Text = ((tohours + (tomin / 60)) + ":" + (tomin % 60)).ToString();
}
}