G
Guest
Hey guys,
Is there ANY way to accomplish this: (see below)? Basically, I want to
have a loop (a < 3 is just for testing purposes, it will be an underermined
amount). In this loop, I want to be able to create a new cell each time. In
this cell, I want the variable name to change. Is this at ALL possible? I've
never been able to figure this out in some of the other languages.
Any help would GREATLY be appreciated.
TableRow tmRow = new TableRow();
tblCreditCards.Rows.Add(tmRow);
int a = 0;
while (a < 3)
{
TableCell tmCell = new TableCell();
tmRow.Cells.Add(tmCell);
CheckBox chk = new CheckBox();
chk.Text = "This is a test for #" + a;
tmCell.Controls.Add(chk);
tmRow.Cells.Add(tmCell);
a++;
}
would it be something like this???
TableRow tmRow = new TableRow();
tblCreditCards.Rows.Add(tmRow);
int a = 0;
while (a < 3)
{
TableCell tmCell#a# = new TableCell();
tmRow.Cells.Add(tmCell#a#);
CheckBox chk#a# = new CheckBox();
chk#a#.Text = "This is a test for #" + a;
tmCell#a#.Controls.Add(chk);
tmRow#a#.Cells.Add(tmCell#a#);
a++;
}
Thanks!!!
Is there ANY way to accomplish this: (see below)? Basically, I want to
have a loop (a < 3 is just for testing purposes, it will be an underermined
amount). In this loop, I want to be able to create a new cell each time. In
this cell, I want the variable name to change. Is this at ALL possible? I've
never been able to figure this out in some of the other languages.
Any help would GREATLY be appreciated.
TableRow tmRow = new TableRow();
tblCreditCards.Rows.Add(tmRow);
int a = 0;
while (a < 3)
{
TableCell tmCell = new TableCell();
tmRow.Cells.Add(tmCell);
CheckBox chk = new CheckBox();
chk.Text = "This is a test for #" + a;
tmCell.Controls.Add(chk);
tmRow.Cells.Add(tmCell);
a++;
}
would it be something like this???
TableRow tmRow = new TableRow();
tblCreditCards.Rows.Add(tmRow);
int a = 0;
while (a < 3)
{
TableCell tmCell#a# = new TableCell();
tmRow.Cells.Add(tmCell#a#);
CheckBox chk#a# = new CheckBox();
chk#a#.Text = "This is a test for #" + a;
tmCell#a#.Controls.Add(chk);
tmRow#a#.Cells.Add(tmCell#a#);
a++;
}
Thanks!!!