grvSum.Columns.Clear();
grvSum.AutoGenerateColumns =
"False"
;
DataTable dt = SqlHelper.ExecuteDataSet(conn, CommandType.StoredProcedure,
"cerModule_IndentDetailInfo"
, parms).Tables[0];
BoundField bfProductName =
new
BoundField();
bfProductName.HeaderText =
"商品名称"
;
bfProductName.DataField =
"商品名称"
;
grvSum.Columns.Add(bfProductName);
BoundField bfProductNum =
new
BoundField();
bfProductNum.HeaderText =
"商品数量"
;
bfProductNum.DataField =
"商品数量"
;
grvSum.Columns.Add(bfProductNum);
BoundField bfProductUnit =
new
BoundField();
bfProductUnit.HeaderText =
"商品单位"
;
bfProductUnit.DataField =
"商品单位"
;
grvSum.Columns.Add(bfProductUnit);
BoundField bfProductPrice =
new
BoundField();
bfProductPrice.HeaderText =
"商品单价"
;
bfProductPrice.DataField =
"商品单价"
;
grvSum.Columns.Add(bfProductPrice);
TemplateField tfSum =
new
TemplateField();
Label lblSum =
new
Label();
tfSum.ItemTemplate =
new
sumTemplateField();
tfSum.HeaderText =
"合计"
;
tfSum.ShowHeader =
true
;
grvSum.Columns.Add(tfSum);
grvSum.DataSource = dt;
grvSum.DataBind();