要求用Datagrid显示的结果如下:
No Name Price
1 PA $1.0
2 PB $2.0
3 PC ¥1.0
4 PD ¥2.0
Total $3.0
¥3.0
datagrid 的数据从一存储过程中获得
如何实现上面的DATAGRID
No Name Price
1 PA $1.0
2 PB $2.0
3 PC ¥1.0
4 PD ¥2.0
Total $3.0
¥3.0
datagrid 的数据从一存储过程中获得
如何实现上面的DATAGRID
然后在后面新两行(统计行),再绑定就行了。
{
foreach(DataGridItem oDataGridItem in DataGrid1.Items)
{
float cont;
cont=cont+(float)oDataGridItem.Cells[2].Text+" ,"; //价格
}
}