如何给动态生成的 DropDownList 绑定数据,如何给"txtBuyer" + i绑定数据?
code=csharp] tc = new TableCell();
tl = new DropDownList();
tl.CssClass = "FieldStyle";
tl.ID = "txtBuyer" + i;
tc.Controls.Add(tl);
tr.Cells.Add(tc);[[/code]
------解决方案--------------------------------------------------------
tc = new TableCell();
tl = new DropDownList();
tl.DataSource = 数据源
tl.DataTextField = "显示";
tl.DataValueField = "值";
tc.Controls.Add(tl);
...