Add controls to a html table in code behind
<p>I have a table column name called QUESTIONTEXT where there are 3 questions in that column. so, there's 3 rows of questions. I am adding those questions to the first column which is working like a charm. Now, i want to add a text box or a checkbox or radio button either next to it in the same cell or to the next column in the same row.</p>

<p>I have 1 question.</p>

<p>1: How to add a control to either in the same row as the text i am currently adding or to the next column in the same row in the table?.</p>

<p>SCENARIO: In the same table i have the column QUESTIONTEXT i also have a TYPEID column with numeric data. Either a 1 or a 2</p>

<p>the idea is that i will know what control to generate for that specific question by the TYPEID number</p>

<p>1 for text</p>

<p>2 for checkbox</p>

<p>I can grab the number like this:</p>

<pre><code>if (dataRow["TYPEID"].ToString() == "1")
</code></pre>

<p>So, for the first one its a 1 and i want to add a text box. I just need to generate a text box or checkbox.</p>

<p>Here is how i am currently adding the questions to the first column in the table.</p>

<pre><code>    TableRow tableRow;
        TableCell tableCell;
        foreach (DataTable dataTable in ds.Tables)
        {
            foreach (DataRow dataRow in dataTable.Rows)
            {
                tableRow = new TableRow();
                tableCell = new TableCell();

               TableRow tableRow2 = new TableRow();
                TableCell tableCel2 = new TableCell();

                tableCell.Text = dataRow["QUESTIONTEXT"].ToString();

                if (dataRow["TYPEID"].ToString() == "1")

                tableRow.Cells.Add(tableCell);
                myTable.Rows.Add(tableRow);

            }
        }
</code></pre>

<p>I also created a enum to aid in the process but not sure if it will help!</p>

<pre><code>public enum typeID : byte
    {
        text = 1,
        multiple_choice = 2
    };
</code></pre>

<p>Cant someone help? please!</p>
