G
Guest
Ok, long story short, I've done this:
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;
chk.ID = Convert.ToString(a);
tmCell.Controls.Add(chk);
tmRow.Cells.Add(tmCell);
a++;
}
And I want to be able to retrieve the CHECKED condition on all three of the
checkboxes.
I've tried to determine how I'm supposed to get that value, but I can't seem
to figure it out.
This is where I'm at now:
string temp = Convert.ToString(tmRow.Cells.Count);
Response.Write("<script language='Javascript1.2'>alert('" + temp +
"')</script>");
temp = (Convert.ToString(tmRow.Cells[1].Controls[1].Count));
Response.Write("<script language='Javascript1.2'>alert('" + temp +
"')</script>");
In the last one, I'm trying to get to the properties of the "chk" control.
Wouldn't it be something like this?
Boolean boolTempBoolean = (tmRow.Cells[1].Controls[chk].Checked);
???
Thanks guys...
Todd
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;
chk.ID = Convert.ToString(a);
tmCell.Controls.Add(chk);
tmRow.Cells.Add(tmCell);
a++;
}
And I want to be able to retrieve the CHECKED condition on all three of the
checkboxes.
I've tried to determine how I'm supposed to get that value, but I can't seem
to figure it out.
This is where I'm at now:
string temp = Convert.ToString(tmRow.Cells.Count);
Response.Write("<script language='Javascript1.2'>alert('" + temp +
"')</script>");
temp = (Convert.ToString(tmRow.Cells[1].Controls[1].Count));
Response.Write("<script language='Javascript1.2'>alert('" + temp +
"')</script>");
In the last one, I'm trying to get to the properties of the "chk" control.
Wouldn't it be something like this?
Boolean boolTempBoolean = (tmRow.Cells[1].Controls[chk].Checked);
???
Thanks guys...
Todd