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 7560947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:02:20+00:00 2026-05-30T13:02:20+00:00

I am developing an asp.net application and I got stuck, so I am asking

  • 0

I am developing an asp.net application and I got stuck, so I am asking for some help.

Database: In my database (MySql) I have table ingredient(idI, name, etc.) and each ingredient can have more then one ingredient type(idT, type_name, etc.). Because of many to many relation I have another table which contains id from ingredient and id from ingredient type.

App: In my app I have gridview that shows all the data from ingredient. I use my own method called FillGVIngredient to fill gridview using dataset and data adapter.

Question: How can I display another column in my gridView which will show all the ingredient types that belongs to ingredient id (each row in gridview represents 1 ingredient) with bullet list so that the output will look like this:

Ingredient_Type      Ingredient   id
--------------------------------------
-type 1*             ingredient1   1
-type 2*
-type 3*
--------------------------------------
-type 5              ingredient2   2
-type 6

*ingredient types must be displayed in single cell. Example above shows 2 rows from gridview.

I have tried using template field with bullet list but I don’t know how to iterate through rows so that I would pass the id of ingredient to sql statement of bullet list datasource.

  • 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-05-30T13:02:22+00:00Added an answer on May 30, 2026 at 1:02 pm

    You are on the right track. A BulletedList in a TemplateField is the correct approach. But you should use GridView’s RowDataBound to bind it to it’s DataSource. Have a look:

    protected void GridView1_RowDataBound(Object sender, GridViewRowEventArgs e)
    {
        if(e.Row.RowType == DataControlRowType.DataRow) {
            var rowView = (DataRowView)e.Row.DataItem;
            var bullet = (BulletedList)e.Row.FindControl("BulletedList1");
            // now get the DataSource according to the ID (f.e. rowView["Ingredient_ID"]) 
            bullet.DataSource = getIngredientTypes(rowView["Ingredient_ID"]);
            bullet.DataTextField = "Ingredient_Type";
            bullet.DataValueField = "Type_ID";
            bullet.DataBind();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm developing an asp.net application. In my database i've a classic mono-record settings table.
I am developing an ASP.NET web application and I have some images in the
I'm developing a asp.net application and I use some components. I have a component
We are developing an ASP.NET MVC Application that currently uses it's own database ApplicationData
I am developing an ASP.NET web application that incorporates google maps. I have an
I have been developing a web application with asp.net and I have smoe question
I'm developing an ASP.NET application which needs Windows Authentication. I have the web.config set
I have an ASP.NET MVC application that I'm working on. I've been developing it
I am developing ASP.NET MVC application. I made some changes to save some extra
Hi I am developing an asp.net web application. I have to access one of

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.