0
我创造了一个循环的表ASP页这样分配给TD表中的值:从下拉列表
foreach (ListItem item in check.Items)
{
if (item.Selected)
{
DropDownList drop = new DropDownList();
drop.Items.Add("1");
drop.Items.Add("2");
drop.DataValueField = "1";
drop.DataValueField = "2";
TableRow row = new TableRow();
TableCell celula = new TableCell();
celula.Style.Add("width", "200px");
celula.Style.Add("background-color", "red");
celula.RowSpan = 2;
celula.Text = item.Value;
TableCell celula1 = new TableCell();
celula1.Style.Add("background-color", "green");
celula1.Style.Add("width", "200px");
celula1.RowSpan = 2;
TableCell celula2 = new TableCell();
celula2.Style.Add("width", "200px");
celula2.Style.Add("background-color", "blue");
celula2.Text = "unu";
TableRow row1 = new TableRow();
TableCell cel = new TableCell();
cel.Text = "lalala";
cel.Style.Add("background-color", "brown");
celula1.Controls.Add(drop);
row.Cells.Add(celula);
row.Cells.Add(celula1);
row.Cells.Add(celula2);
row1.Cells.Add(cel);
this.tabel.Rows.Add(row);
this.tabel.Rows.Add(row1);
}
}
对于我检查每一个值,新行与价值创造选中的复选框,下拉列表和2个以上的单元格。现在,我要为我创造,使每个something.So下拉列表如果我选择1第一行的东西会出现,如果我选择1另一行别的东西就会出现。我做了一个selectedindexchangedchanged,但如果我从第一行中选择1,它将显示两行。我如何分别引用我在循环中创建的每个下拉列表?我使用Asp.Net Web应用程序用C#
哪能在使用的SelectedIndexChanged分配给celula.RowSpan从下拉列表的值Δα – Bibu 2012-04-09 12:13:32
u能请解释在下拉菜单中选择指标更改事件确切的功能? – 2012-04-09 12:17:44
所以我有那些下拉每一行创建的列表。例如,我有3行3下拉列表。如果我从第一个下拉列表中选择值1,那么我希望这个值分配给celula.RowSpan,所以它会是这样的: – Bibu 2012-04-09 12:29:20