日期:2014-05-17 浏览次数:20417 次
public partial class PlaceOrder : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)
{
string productInfoId = GridView2.SelectedRow.Cells[0].Text.Trim();
string productName = GridView2.SelectedRow.Cells[1].Text.Trim();
items.Rows.Add(getNewRow(productInfoId, productName));
}
private TableRow getNewRow(string productInfoId,string productName )
{
TableRow tr = new TableRow();
tr.BorderWidth = 1;
//1
TableCell tc = new TableCell();
tc.Visible = false;
tc.Text = productInfoId;
tr.Cells.Add(tc);
//2
tc = new TableCell();
tc.Width = 150;
tc.Text = productName;
tr.Cells.Add(tc);
//3
tc = new TableCell();
tc.Width = 70;
TextBox tb = new TextBox();
tb.Width = 30;
tc.Controls.Add(tb);
Label