Datasource needed to link supplier with products for each supplier

chorestAccorn

New Member
We would like to display in a GridView suppliers and a bulleted list of the products for each of the products that are displayed.For example:\[code\]Supplier One Product A Product BSupplier Two Product A Product B Product C\[/code\]This is what the GridView looks like:\[code\] <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CssClass="DataWebControlStyle"> <HeaderStyle CssClass="HeaderStyle" /> <AlternatingRowStyle CssClass="AlternatingRowStyle" /> <Columns> <asp:BoundField DataField="CompanyName" HeaderText="Supplier" /> <asp:TemplateField HeaderText="Products"> <ItemTemplate> <asp:BulletedList ID="BulletedList1" runat="server" DataSource='<%# %>' DataTextField="ProductName"> </asp:BulletedList> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView>\[/code\]This is the code-behind file that loads the data into the GridView:\[code\]Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim suppliersAdapter As New SuppliersTableAdapter GridView1.DataSource = suppliersAdapter.GetSuppliers() GridView1.DataBind()End Sub\[/code\]Can you tell us what to place in the asp:BulletedList DataSouce so the products can also be shown?
 
Back
Top