<asp:LinqDataSource
ContextTypeName="ExampleDataContext"
TableName="Products"
GroupBy="new(ProductCategory,Color)"
Select="new(Key,
It As Products,
Max(ListPrice) As MaxListPrice,
Min(ListPrice) As MinListPrice)"
ID="LinqDataSource1"
runat="server">
</asp:LinqDataSource><asp:ListView
DataSourceID="LinqDataSource1"
ID="ListView1"
runat="server">
<LayoutTemplate>
<table style="background-color:Teal;color:White"
runat="server"
class="Layout">
<thead>
<tr>
<th><b>Product Category</b></th>
<th><b>Color</b></th>
<th><b>Highest Price</b></th>
<th><b>Lowest Price</b></th>
</tr>
</thead>
<tbody runat="server" id="itemContainer">
</tbody>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr>
<td><%# Eval("Key.ProductCategory") %></td>
<td><%# Eval("Key.Color") %></td>
<td><%# Eval("MaxListPrice") %></td>
<td><%# Eval("MinListPrice") %></td>
</tr>
<tr>
<td colspan="4">
<asp:ListView
DataSource='<%# Eval("Products") %>'
runat="server"
ID="ListView2">
<LayoutTemplate>
<div
style=" width:100%;background-color:White;color:Black"
runat="server"
id="itemContainer">
</div>
</LayoutTemplate>
<ItemTemplate>
<%# Eval("ProductName") %><br />
</ItemTemplate>
</asp:ListView>
</td>
</tr>
</ItemTemplate>
</asp:ListView>