for(int i=2; i < this.dgShowOlNum.Columns.Count; i++)
{
int total =0;
for(int j=0;j<this.dgShowOlNum.Items.Count;j++)
{
string text = this.dgShowOlNum.Items[j].Cells[i].Text.ToString().Trim();
if (Regex.Matches(text, @"[^\d\.]").Count > 0)
{
text="0";
}
total += Convert.ToInt32(text);
if (e.Item.ItemType == ListItemType.Footer)
{
e.Item.Cells[i].Text = total.ToString();
e.Item.Cells[1].Text = "总计";
}
}
}
}