H
Harlan Messinger
I've got an Item table and a Category table. The Category table has
columns categoryId and categoryName. The Item table has a categoryId
that is a foreign key into Category, and a column called typeId.
I've created a DataContext for my database. It generally works as expected.
I want to display the items grouped by category, with group headings. So
I created a LinqDataSource based on my data context to provide the
Category data, and created a ListView that uses it as a source and it
displays my category names.
In the ItemTemplate, under the category name, I have
<asp:ListView ID="listviewItem" runat="server"
DataSource='<%#Eval("Items") %>'>
This works too. I have configured this inner ListView to list data from
the items, and they care correctly listed under the appropriate categories.
HOWEVER: what do I do if I want to list only the Items having typeId=3?
columns categoryId and categoryName. The Item table has a categoryId
that is a foreign key into Category, and a column called typeId.
I've created a DataContext for my database. It generally works as expected.
I want to display the items grouped by category, with group headings. So
I created a LinqDataSource based on my data context to provide the
Category data, and created a ListView that uses it as a source and it
displays my category names.
In the ItemTemplate, under the category name, I have
<asp:ListView ID="listviewItem" runat="server"
DataSource='<%#Eval("Items") %>'>
This works too. I have configured this inner ListView to list data from
the items, and they care correctly listed under the appropriate categories.
HOWEVER: what do I do if I want to list only the Items having typeId=3?