title: Adding a control to repeater item template programmatically
body: <p>I'm creating a control that will mimic the functionality of a 'grouped repeater', whilst allowing them to define a template for each group header and another template for each group item.</p>
  
  <p>My approach to this is to create a new class that has two public ITemplate members that will expose a way of defining the markup for these two templates on the page. I will then take the first template and assign it to the ItemTemplate of the 'parent repeater' and then the second template will be assigned to the ItemTemplate of the child repeater.</p>
  
  <p>All fine so far.</p>
  
  <p>Now I'm left with the problem of adding the child repeater to the ItemTemplate of the parent. A solution to this would be to add a control (possibly a placeholder) to the ItemTemplate of the parent repeater and then, on ItemDataBound, add the child repeater to the control collection of the placeholder, but I don't have this luxury as I cannot assume a PlaceHolder will be declared in the ItemTemplate on the page's markup.</p>
  
  <p>I either need to:</p>
  
  <p><strong>A. Add the child repeater to the ItemTemplate of the parent repeater programmatically some other way (I don't know how)</strong></p>
  
  <p>or</p>
  
  <p><strong>B: Add a placeholder to the ItemTemplate of the parent repeater so that on ItemDataBound I can do what I need to do to get the child repeater in there</strong></p>
  
  <p>A suggestion of how I could achieve either of the two above solutions is what I'm after. Any help much appreciated.</p>
  
  <p>I'm also open to alternative approaches if necessary.</p>