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

  • Home
  • SEARCH
  • 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 9225543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:36:11+00:00 2026-06-18T04:36:11+00:00

I am trying to make a program that has a data grid that shows

  • 0

I am trying to make a program that has a data grid that shows on each row, List of Ingredients the pizza has, the pizza name, and the price of the pizza. I can get the data grid to show the name and price, but i am having trouble getting it to show the list of ingredients. The data grid’s datasource is a binding list of a class called Pizza.

    class Pizza
{
    private List<Ingredients> ingredientList_;
    private string pizzaName_;
    private decimal retailPrice_;

    public Pizza(List<Ingredients> ingredientList, string pizzaName, decimal retailPrice)
    {
        ingredientList_ = ingredientList;
        pizzaName_ = pizzaName;
        retailPrice_ = retailPrice;
    }

It has the basic get and set properties.
I also have an Ingredient class.

    class Ingredients
{
    private string name_;
    private int servingSize_;
    private int energyValue_;
    private decimal purchasePrice_;
    private bool isVegetarian_;

    public Ingredients(string name, int servingSize, int energyValue, decimal purchasePrice, bool isVegetarian)
    {
        name_ = name;
        servingSize_ = servingSize;
        energyValue_ = energyValue;
        purchasePrice_ = purchasePrice;
        isVegetarian_ = isVegetarian;
    }

Has the basic get and set properties.

In my form code, I have:

    private BindingList<Pizza> pizzaList_;


    pizzaList_ = new BindingList<Pizza>();
        dataGridViewPizzaMenu.DataSource = pizzaList_;

Now my problem is that i am trying to use a combo box column to show the ingredients in a pizza when i click on it. But i can’t seem to create a bound column for the Ingredients, only the pizza name and pizza price. Am i missing something or is what i am trying to do not possible?

  • 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-18T04:36:12+00:00Added an answer on June 18, 2026 at 4:36 am

    Everything you’ve done appears correct. The problem I think is the way the DataGridView is setup at Design or Runtime.

    If you head over to this answer you can see the steps you need to take:
    Add all elements of array to datagridview rows except one

    • The trick with binding the 1st combobox column is a BindingSource. In design time > right click on the DataGridView > choose Edit Columns > select the first column > choose DataSource > click Add Project DataSource > choose Object > then tick the Ingredients class and click Finish.

    • Remeber to set the 1st ComboBox columns DataMember to ingredientList, you will need to select the IngredientsDataBindingSource control that was added (slightly below the Form Design’s surface – in the gray area)

    • 2nd and 3rd add two TextBox columns for pizzaName and retailPrice and set there DataPropertyName accordingly.

     pizzaList_ = new BindingList<Pizza>();
     //Insert code to populate the List of Pizza's and Ingredients
     dataGridViewPizzaMenu.AutoGenerateColumns = false;
     dataGridViewPizzaMenu.DataSource = pizzaList_;
     ingredientsDataBindingSource.DataSource = pizzaList_.ingredientsList_;    
    

    ps There is a downloadable sample in the link I referred to above.

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

Sidebar

Related Questions

HI all. I am trying to make little program that reads data from file
I am trying to make a program that has 2 views. The first view
I'm trying to make a program in Visual C# that has my one created
Im trying to make a program that retrieves an endless amount of numbers that
I'm trying to make a program that, using pointers, detects lines in an image
I'm trying to make a program that lets you input any one-step equation, and
I'm trying to make a program that can be hosted by many peoples, like
I am trying to make a program that can take an .mp3 file from
I am trying to make a program that automatically corrects the perspective of a
I'm trying to make a program that reads the value at a certain address.

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.