Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to add rows dynamically to Table with controls embedded inside the table
Posted
Comments
Mohd. Mukhtar 23-Nov-12 3:25am    
What have you tried?

1 solution

I think this will help you
XML
<asp:Table runat="server" ID="table1" Width="40%" GridLines="Both" BackColor="white">
                       </asp:Table>

TableRow trow = new TableRow();
          TableCell tcellcolname = new TableCell();
          tcellcolname.Text = "column header";
          tcellcolname.Controls.Add(new TextBox());
          trow.Cells.Add(tcellcolname);
          table1.Rows.Add(trow);
 
Share this answer
 
Comments
arevant 23-Nov-12 3:57am    
I'll have to display one lable in one column and a dropdown in the other column. Upon the selection of value from the first dropdown list we will have to display the second question with options. like that we will have to dynamically generate the rows.
please help me out on this

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900