Reegan Fernando

Reegan Fernando

  • NA
  • 5
  • 5.1k

Adding row dynamically inside the table

Jul 17 2009 3:21 PM
Greetings to all,

I am having some issues with inserting row in the existing table. I will explain it briefly.

I am having a form with several Input controls. While retrieving data from database it have to create a input controls dynamically and store the values in that control. For that while creting a row inside the row, am getting error. I enclosed the code below.

                    TableRow trow = new TableRow();                   
                    TableCell td = new TableCell();
                    tblPlan.Rows.Add(trow);
                  
                    TableCell tdplan = new TableCell();
                    trow.Cells.Add(tdplan); //am getting error in this line.
                    System.Web.UI.HtmlControls.HtmlInputText inputplanname = new System.Web.UI.HtmlControls.HtmlInputText();
                        inputplanname.ID = "Planname";
                        inputplanname.Size = 30;
                        td.Controls.Add(inputplanname);

PLease guide me.

Thanks and Regards,

Reegan.B

Answers (1)