ASP.NET server-control implementation
<DNL:DbNetGrid
id="customersGrid"
runat="server"
ConnectionString = "SamplesDatabase"
FromPart = "customers"
>
<GridColumns>
<DNL:GridColumn ColumnExpression="CompanyName"/>
<DNL:GridColumn ColumnExpression="ContactName"/>
<DNL:GridColumn ColumnExpression="ContactTitle"/>
<DNL:GridColumn ColumnExpression="City"/>
</GridColumns>
</DNL:DbNetGrid>
ASP.NET server-control (Code-behind) implementation
protected void Page_Load()
{
base.Page_Load();
DbNetGrid CustomerGrid = new DbNetGrid();
CustomerGrid.ID = "customersGrid";
CustomerGrid.ConnectionString = "SamplesDatabase";
CustomerGrid.FromPart = "customers";
CustomerGrid.GridColumns.Add( "CompanyName" );
CustomerGrid.GridColumns.Add( "ContactName" );
CustomerGrid.GridColumns.Add( "ContactTitle" );
CustomerGrid.GridColumns.Add( "City" );
Page.Form.Controls.Add(CustomerGrid);
}
Client-side JavaScript implementation
jQuery(document).ready( init )
function init()
{
var dbnetgrid1 = new DbNetGrid("dbnetgrid1");
with (dbnetgrid1)
{
fromPart = "customers"
connectionString = "SamplesDatabase"
setColumnExpressions("CompanyName","ContactName","ContactTitle","City");
initialize()
}
}