title: Small Web App, Adding repeater grid items dynamically
body: <pre><code>private void BindGridToppings()
      {
  
      }
  </code></pre>
  
  <p>here's the gridview from the asp page</p>
  
  <pre><code>&lt;asp:GridView ID="gridv" runat="server" AutoGenerateColumns="false" EnableModelValidation="true" OnRowDataBound="Pizzas_RowBound"&gt;
      &lt;Columns&gt;
          &lt;asp:TemplateField HeaderText="Edit"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:ImageButton ImageUrl="~/images/edit.png" ID="btnEditPizza" runat="server" RowIndex='&lt;%# Container.DisplayIndex %&gt;' onClick="Pizzas_RowEditing" /&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField HeaderText="Delete"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:ImageButton ImageUrl="~/images/del.png" ID="btnDeletePizza" runat="server" RowIndex='&lt;%# Container.DisplayIndex %&gt;' OnClick="Pizzas_RowDeleting" /&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:BoundField  DataField="Name" HeaderText="Name" SortExpression="Name" /&gt;
          &lt;asp:TemplateField HeaderText="Pizza ID" &gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="lblID" runat="server" Text='&lt;%#DataBinder.Eval(Container.DataItem, "ID").ToString() %&gt;'&gt;&lt;/asp:Label&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField HeaderText="Crust"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="lblCrust" runat="server" Text='&lt;%#GetNameByLookUpID(DataBinder.Eval(Container.DataItem, "Crust").ToString()) %&gt;'&gt;            &lt;/asp:Label&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:TemplateField HeaderText="Cheese"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Label ID="lblCheese" runat="server" Text='&lt;%#GetNameByLookUpID(DataBinder.Eval(Container.DataItem ,"Cheese").ToString()) %&gt;'&gt;&lt;/asp:Label&gt;
              &lt;/ItemTemplate&gt;
          &lt;/asp:TemplateField&gt;
          &lt;asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" /&gt;
          &lt;asp:BoundField DataField="Cost" HeaderText="Cost" SortExpression="Cost" DataFormatString="{0:C}" /&gt;
          &lt;asp:TemplateField HeaderText="Toppings"&gt;
              &lt;ItemTemplate&gt;
                  &lt;asp:Repeater ID="rptList" Runat="server"&gt;                            
                  &lt;/asp:Repeater&gt;
              &lt;/ItemTemplate&gt;                
          &lt;/asp:TemplateField&gt;
      &lt;/Columns&gt;                
  &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>SQL and SubSonic are used as the backend, I only started programming with a database two weeks ago. So accessing it is still new to me.</p>
  
  <p>Either my DB.Where...... call was incorrectly formatted in the BindGridToppings function as the complimer told me. Or A subsonic query is not a class that can be interated, as my compiler told me when I tried a foreach loop and .items.add</p>
  
  <p>Any advice on how to bind this repeater would be lovely.</p>
  
  <p>Thanks, Macaire Bell</p>