well i finish it with this code below put in datarowbound.
protected void GridView1_RowDataBound1(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
total = 0;
int intex = GetColumnIndexByName(e.Row, "Category");
if (e.Row.Cells[intex].Text == "Class")
{
var jo = 1;
var ro = 2;
while (jo <= days)
{
if (e.Row.Cells[ro].Text == " ")
{
e.Row.Cells[ro].Text = "0";
}
if (!Convert.IsDBNull(e.Row.Cells[ro].Text))
{
_total[jo] += Convert.ToDecimal(e.Row.Cells[ro].Text);
total = total + Convert.ToDecimal(e.Row.Cells[ro].Text);
if (jo == days)
{
e.Row.Cells[ro + 1].Text = Convert.ToString(total);
}
}
ro += 1;
jo += 1;
}
}
}
}