日期:2014-05-17 浏览次数:20612 次
前台:
<asp:GridView ID="gv" runat="server">
<Columns>
</Columns>
</asp:GridView>
后台:
DataRow row;
DataTable dtTpQty = new DataTable();
dtTpQty.Columns.Add("ID");
dtTpQty.Columns.Add("type");
dtTpQty.Columns.Add("qty");
row = dtTpQty.NewRow();
row["ID"] = "0001";
row["type"] = "0";
row["qty"] = "2500";
dtTpQty.Rows.Add(row);
row = dtTpQty.NewRow();
row["ID"] = "0001";
row["type"] = "1";
row["qty"] = "3100";
dtTpQty.Rows.Add(row);
row = dtTpQty.NewRow();
row["ID"] = "0001";
row["type"] = "2";
row["qty"] = "2600";
dtTpQty.Rows.Add(row);
row = dtTpQty.NewRow();
row["ID"] = "0001";
row["type"] = "3";
row["qty"] = "1500";
dtTpQty.Rows.Add(row);
row = dtTpQty.NewRow();
row["ID"] = "0002";
row["type"] = "0";
row["qty"] = "1100";
dtTpQty.Rows.Add(row);
row = dtTpQty.NewRow();
row["ID"] = "0002";
row["type"] = "1";
row["qty"] = "4200";
dtTpQty.Rows.Add(row);
row = dtTpQty.NewRow();
row["ID"] = "0002";
row["type"] = "2";
row["qty"] = "3200";
dtTpQty.Rows.Add(row);
&nb