标签: c# datagridview
我有DataGridView这样:
DataGridView
代码如何从Column Total计算数据并在Label中显示?这意味着Label将显示2650
Column Total
Label
答案 0 :(得分:0)
int total= 0; for (int i = 0; i < dataGridView.Rows.Count; ++i) { sum += Convert.ToInt32(dataGridView.Rows[i].Cells[x].Value); //x=column index } label.text = sum.ToString();