double sum = 0.00;for (int i = 0; i < this.GridView1.Rows.Count; i++)
{
try
{
sum += Convert.ToDouble(this.GridView1.Rows[i].Cells[5].Text.Trim());//针对模板列的方法然后对s处理
string s = GridView1.Rows[i].Cells[2].FindControl("lblSalary") as Label).Text.ToString();}catch{continue;}}this.labTotalPayNum.Text = sum.ToString("c");
统计GridView某一列值的总和放在label中
最新推荐文章于 2023-12-19 10:31:45 发布