小白求助 GridView 加合计行不显示 数据

GridView 加合计行不显示 

double sum1 = 0;
                
        protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
               
                sum1 += Convert.ToDouble(e.Row.Cells[7].Text);
                

            }
            // 合计
            else if (e.Row.RowType == DataControlRowType.Footer)
            {
                e.Row.Cells[0].Text = "合计";
               e.Row.Cells[7].Text = sum1.ToString();
               
            }
        }

哪位朋友帮忙瞅瞅