<link rel="stylesheet" type="text/css" href="dbnetsuite.css.ashx" /> <script language="JavaScript" src="dbnetsuite.js.ashx"></script>
<script language="JavaScript"> jQuery(document).ready( init ) function init() { var dbnetgrid1 = new DbNetGrid("dbnetgrid1"); with (dbnetgrid1) { updateRow = false; fromPart = "categories"; insertRow = false; connectionString = "SamplesDatabase"; setColumnExpressions("CategoryName","Description","CategoryID"); setColumnLabels("Name","Description","Products"); setColumnProperty("CategoryID","lookup","select CategoryID, count(*) from products group by CategoryID"); setColumnProperty("CategoryID","primaryKey",true); addNestedGrid(configureProductsGrid); initialize() } } function configureProductsGrid(grid){ with (grid) { fromPart = "products"; connectionString = "SamplesDatabase"; setColumnExpressions("ProductID","ProductName","SupplierID","CategoryID","UnitPrice"); setColumnLabels("","Name","Supplier","","Price"); setColumnProperty("ProductID","display",false); setColumnProperty("SupplierID","lookup","select SupplierId, CompanyName from suppliers"); setColumnProperty("CategoryID","foreignKey",true); setColumnProperty("CategoryID","display",false); setColumnProperty("UnitPrice","format","C"); } } </script>
<div id="dbnetgrid1"></div>