how to create multiple row at runtime?
bellow code is creating only one row in a existing table named Table1 instead i want to get 4 row each row containing 2 cell with textbox.waht i have..i am only unable to create 4 rows...plz help
int numcells = 2;
TableRow r = new TableRow();
for (int j = 0; j < 4; j++)
{
Table1.Rows.Add(r);
for (int i = 0; i < numcells; i++)
{
TableCell c = new TableCell();
TextBox textb = new TextBox();
textb.ID = "txtR" + Table1.Rows.Count + "C" + i;
textb.EnableViewState = true;
c.Controls.Add(textb);
r.Cells.Add(c);
}
}