Generate repeaters according to user inputs
<p>I have a DataList control on my webpage, the rows of which are populated by ItemTemplate. Each row has a check box, and on button click, I am generating as a string which is actually a <code>sql</code> query text.</p>

<p>Each result returned by the query from the DB has 10 rows which are to be shown in another DataList, as something like this:</p>

<pre><code>&lt;Header&gt;

Item1: Result1
Item2: Result2
Item3: Result3
...
Item10: Result10
</code></pre>

<p>The problem is that I do not know how many checkboxes will be selected by the user, and according the number of results returned will be unknown.
So, if the user selects two checkboxes from the first DataList, the result DataList should have two columns:</p>

<pre><code>&lt;Header1&gt;                  &lt;Header2&gt;

Item1: Result1    | Item 1: ResultCol2
Item2: Result2    | Item 2: ResultCol2
Item3: Result3    | Item 3:ResultCol2
...
Item10: Result10 | Item 10: ResultCol2
</code></pre>

<p>I tried to think of a solution for this. Let's say a user selects two check boxes:</p>

<pre><code>foreach checkbox selected by the user
    Make a new repeater. Add a new header. 
    Fetch the data from the database (Each result contains 10 columns) and bind to the repeater.
    Add the repeater to a container on the web page.
</code></pre>

<p>Now, I remember that in windows forms, such addition of runtime generated controls can be done by something like <code>TableLayout.Add(childElements)</code></p>

<p>But, I am not able to think of something similar in Web Forms. Is this actually the correct approach? How can this kind of dynamic building of DataControl achieved in this case?</p>
