日期:2014-05-17 浏览次数:21026 次
private static double getDataGridColumnSumByIndex(DataGrid dataGrid,int index)
{
double result = 0.0; //返回的结果
double temp = 0.0; //中间变量
for (int i = 1; i < dataGrid.Items.Count;i++ )
{
double.TryParse((dataGrid.Columns[index].GetCellContent(dataGrid.Items[i]) as TextBlock).Text.ToString(),out temp);
result += temp;
}
return result;
}