private double sum = 0;//取指定列的数据和,你要根据具体情况对待可能你要处理的是int
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
       
        if (e.Row.RowIndex >= 0)
        {
            sum += Convert.ToDouble(e.Row.Cells[6].Text);
        }
        else if (e.Row.RowType == DataControlRowType.Footer)
        {
            e.Row.Cells[5].Text = "总薪水为:";
            e.Row.Cells[6].Text = sum.ToString();
            e.Row.Cells[3].Text = "平均薪水为:";
            e.Row.Cells[4].Text = ((int)(sum / GridView1.Rows.Count)).ToString();
           
        }
    }

相关文章:

  • 2022-12-23
  • 2021-07-26
  • 2021-10-25
  • 2022-02-06
  • 2021-11-09
  • 2021-11-28
猜你喜欢
  • 2021-10-20
  • 2021-05-24
  • 2022-12-23
  • 2021-11-13
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案