Example
Source
Run as client-side object
Use the
NestedGrid
property to create nested grids that allow you to drill-down into your data.
Register the component libraries
<%@ Register TagPrefix="DNL" Namespace="DbNetLink.Web.UI" Assembly="DbNetLink.DbNetGrid" %>
Server Control
<form id="Form1" name="Form1" method="post" runat="server"> <table> <tr> <td> <DNL:DbNetGrid id="customers" runat="server" ConnectionString="samples" FromPart="customers" PrimaryKeyColumn="customerid" VirtualDir=".." Headings = "Customer Name,Address,City,Phone,Fax" SelectPart = "companyname,address,city,phone,fax" PageSize="10" NestedColumnColour="white" > <NestedGrid id="orders" runat="server" ConnectionString="samples" FromPart="orders" PrimaryKeyColumn = "orderid" ForeignKeyColumn = "customerid" VirtualDir=".." SelectPart="orderid,orderdate,requireddate,shippeddate" Headings="Order Id,Order Date,Required Date,Shipped Date" DisplayToolbar="false" > <NestedGrid id="orderDetails" runat="server" FromPart="[order details] inner join products on [order details].productid = products.productid" ForeignKeyColumn="orderid" SelectPart="productname,[order details].unitprice,quantity,discount" Headings="Product,Unit Price,Quantity,Discount" DisplayToolbar="false" > <GridColumnProperties> <DNL:ColumnProperty ColumnName="[order details].unitprice" Property="format" Value="c"></DNL:ColumnProperty> </GridColumnProperties> </NestedGrid> </NestedGrid> </DNL:DbNetGrid> </td> </tr> </table> </form>
Styles
tr.nestedLevel1 td.treeContainer { background-color:#bbff66; padding:5px; } tr.nestedLevel1 tr.evenRow { background-color:#bbff66; } tr.nestedLevel2 td.treeContainer { background-color:#ffdd44; padding:5px; } tr.nestedLevel2 tr.evenRow { background-color:#ffdd44; }