I have an asp.net table management as follows:
TableHeader A Text | Textbox
What I want to do, in the page_load event, is to duplicate the second line with all the controls inside it, change the text in the first cell and add it as a new line. So here is my code:
for (int i = 0; i < loop1counter; i++) { TableRow row = new TableRow(); row = myTable.Rows[1]; //Duplicate original row char c = (char)(66 + i); if (c != 'M') { row.Cells[0].Text = c.ToString(); myTable.Rows.Add(row); } }
But when I execute this code, it just overwrites the original row, and the number of rows in the table does not change. Thanks for the help....
source share