title: Repeater and add columns to header and itemtemplate on page load
body: <p>I haven't used repeaters for much more than showing data from a datatable.</p>
  
  <p>I am building a grid that that shows a list of users and columns of roles that the user has been assigned, shown with checkboxes (shown with true/false below but pretent they are checkboxes).</p>
  
  <p>ex.</p>
  
  <p>|Rep Name|Caller|Closer|Manager|SuperUser|<br />
  |Bob&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|True  |true&nbsp;&nbsp;  | false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | false   |<br />
  |Tom     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|false&nbsp; |false&nbsp; |True &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  | True    |<br /></p>
  
  <p>Basically using it for roles management.</p>
  
  <p>However the roles may change later on so I want to load the roles(headers and items) dynamically into the repeater.</p>
  
  <p>I am not sure how to do this or if it is even possible.</p>
  
  <p>I figure you grab a list of current role possibilities and load them into the headertemplate but I am not sure how to match those with the itemtemplate and how to create checkboxes and place them in the itemtemplate.</p>
  
  <p>Sorry if it is a rudementary question....  I appreciate any advice!</p>
  
  <p>Datatable example of data that I am going to get... though I will also return ids for roles and users that are not shown here.</p>
  
  <p>DataTable dt = new DataTable();
            DataColumn dc = new DataColumn();</p>
  
  <pre><code>      dc.DataType = Type.GetType("System.String");
        dc.ColumnName = "RepName";
        dt.Columns.Add(dc);
  
        dc = new DataColumn(); 
        dc.DataType = Type.GetType("System.Boolean");
        dc.ColumnName = "Caller";
        dt.Columns.Add(dc);
  
        dc = new DataColumn();
        dc.DataType = Type.GetType("System.Boolean");
        dc.ColumnName = "closer";
        dt.Columns.Add(dc);
  
        dc = new DataColumn();
        dc.DataType = Type.GetType("System.Boolean");
        dc.ColumnName = "Admin";
        dt.Columns.Add(dc);
  
        dc = new DataColumn();
        dc.DataType = Type.GetType("System.Boolean");
        dc.ColumnName = "SuperUser";
        dt.Columns.Add(dc);
  
  
        DataRow row;
  
        row = dt.NewRow();
  
        row["RepName"] = "Joe";
        row["Caller"] = true;
        row["closer"] = false;
        row["Admin"] = true;
        row["SuperUser"] = false;
        dt.Rows.Add(row);
  
        row = dt.NewRow();
  
        row["RepName"] = "Bob";
        row["Caller"] = true;
        row["closer"] = false;
        row["Admin"] = true;
        row["SuperUser"] = false;
        dt.Rows.Add(row);
  
  
        row = dt.NewRow();
  
        row["RepName"] = "Tom";
        row["Caller"] = true;
        row["closer"] = false;
        row["Admin"] = true;
        row["SuperUser"] = false;
        dt.Rows.Add(row);
  </code></pre>