Click here to Skip to main content
15,901,373 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
foreach (string item in valueslist)
                    {
                        
                        TableRow tr = new TableRow();
                        TableCell tc = new TableCell();
                        Label lb = new Label();

                        TextBox tb1 = new TextBox();// this textbox is place table in second column.
                        tb1.ID = "tb" + i.ToString();


                        lb.Text = item;
                        string ids = string.Format("lb{0}", i);
                        lb.ID = ids;
                        tc.Controls.Add(lb);
                        tr.Controls.Add(tc);
                        table.Controls.Add(tr);
                        tc.Controls.Add(tb1);

                                            

                        i++;
                    }
Posted
Updated 24-Jul-12 4:40am
v2
Comments
[no name] 24-Jul-12 10:49am    
Is there a question here?

1 solution

Hi ,
Check this
C#
int i = 1;
      foreach (string item in lst)
      {
          TableRow tr = new TableRow();
          TableCell tc = new TableCell();
          TableCell col2 = new TableCell();

          Label lb = new Label();
          lb.Text = item;

          TextBox tb1 = new TextBox();// this textbox is place table in second column.
          tb1.ID =  "txt"+i;
          tb1.Text = "col2";
          string ids = string.Format("lb{0}", i);
          lb.ID = ids;
          tc.Controls.Add(lb);
          col2.Controls.Add(tb1);

          tr.Controls.Add(tc);
          tr.Controls.Add(col2);


          Table1.Controls.Add(tr);

          i++;
      }

Best Regards
M.Mitwalli
 
Share this answer
 

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