private void BindGridToppings()
{
}
here’s the gridview from the asp page
<asp:GridView ID="gridv" runat="server" AutoGenerateColumns="false" EnableModelValidation="true" OnRowDataBound="Pizzas_RowBound">
<Columns>
<asp:TemplateField HeaderText="Edit">
<ItemTemplate>
<asp:ImageButton ImageUrl="~/images/edit.png" ID="btnEditPizza" runat="server" RowIndex='<%# Container.DisplayIndex %>' onClick="Pizzas_RowEditing" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Delete">
<ItemTemplate>
<asp:ImageButton ImageUrl="~/images/del.png" ID="btnDeletePizza" runat="server" RowIndex='<%# Container.DisplayIndex %>' OnClick="Pizzas_RowDeleting" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:TemplateField HeaderText="Pizza ID" >
<ItemTemplate>
<asp:Label ID="lblID" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "ID").ToString() %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Crust">
<ItemTemplate>
<asp:Label ID="lblCrust" runat="server" Text='<%#GetNameByLookUpID(DataBinder.Eval(Container.DataItem, "Crust").ToString()) %>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cheese">
<ItemTemplate>
<asp:Label ID="lblCheese" runat="server" Text='<%#GetNameByLookUpID(DataBinder.Eval(Container.DataItem ,"Cheese").ToString()) %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
<asp:BoundField DataField="Cost" HeaderText="Cost" SortExpression="Cost" DataFormatString="{0:C}" />
<asp:TemplateField HeaderText="Toppings">
<ItemTemplate>
<asp:Repeater ID="rptList" Runat="server">
</asp:Repeater>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
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.
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
Any advice on how to bind this repeater would be lovely.
Thanks, Macaire Bell
found a solution.
with
in the front
Thank you for you’re help though it led me to my answer!