Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8002141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:16:29+00:00 2026-06-04T16:16:29+00:00

private void BindGridToppings() { } here’s the gridview from the asp page <asp:GridView ID=gridv

  • 0
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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:16:30+00:00Added an answer on June 4, 2026 at 4:16 pm

    found a solution.

        protected void Pizzas_RowBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                int pizzaID = Convert.ToInt32(((Label)e.Row.FindControl("lblID")).Text);
                BulletedList bltTopping = ((BulletedList)e.Row.FindControl("bltTopping"));
                ToppingsCollection toppings = ToppingsMembers.RetriveByPizzaID(pizzaID);
                bltTopping.Items.Clear();
                foreach (Toppings topping in toppings)
                {
                bltTopping.Items.Add(new ListItem(GetNameByLookUpID(topping.ToppingID.ToString())));
            }
        }
    }
    

    with

                <asp:TemplateField HeaderText="Toppings">
                    <ItemTemplate>                
                        <asp:BulletedList ID="bltTopping" Runat="server">                            
                        </asp:BulletedList>
                    </ItemTemplate>                
                </asp:TemplateField>
    

    in the front

    Thank you for you’re help though it led me to my answer!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

private void BindCountry() { XmlDocument doc = new XmlDocument(); doc.Load(Server.MapPath(countries.xml)); foreach (XmlNode node in
private void launchbutton_Click(object sender, EventArgs e) { launchbutton.Enabled = false; Process proc = new
private void BuildGridView2() { GridView1.DataSource = new Select() .From(NewsReleases) .Where(RelMonth).IsEqualTo(this.ddlAward.SelectedValue) .And(RelYear).IsEqualTo(this.ddlYear.SelectedValue) .OrderAsc(RelDate) .ExecuteDataSet(); }
private void but_Click(object sender, RoutedEventArgs e) { (sender as Button).IsEnabled = false; doSomeThing();//e.g run
private void StringAction(string aString) // method to be called { return; } private void
private void EnsureCurrentlyValid() { //I'm valid if IDataErrorInfo.this[] returns null for every property var
private void validateXML(DOMSource source) throws Exception { URL schemaFile = new URL(http://www.csc.liv.ac.uk/~valli/modules.xsd); SchemaFactory schemaFactory
private void save(Rectangle src, Rectangle dest, string fName, int width, int height, Bitmap file)
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (e.CloseReason == CloseReason.UserClosing) { if (MessageBox.Show(this,
private void refineWords() { for(String word : words){ Log.i(word, word); if (word == s

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.