<script>
jQuery(document).ready( init )
function init()
{
var dbnetgrid1 = new DbNetGrid("dbnetgrid1");
with (dbnetgrid1)
{
connectionString = "AdventureWorks"
fromPart = "customer"
setColumnExpressions("CustomerID", "Title", "FirstName", "LastName", "CompanyName", "EmailAddress", "Phone", "ModifiedDate");
setColumnProperty(["CustomerID", "Title", "FirstName", "LastName", "CompanyName", "EmailAddress", "Phone"],"InlineEdit",true);
setColumnProperty(["Title","FirstName","LastName"],"required",true);
setColumnProperty("ModifiedDate","readOnly",true);
setColumnProperty("Title","lookup","select distinct title from customer where title is not null");
bind("onBeforeRecordBatchUpdated", setModifiedDate)
pageSize = 10
initialize()
}
}
///////////////////////////////////////////////////////////////
function setModifiedDate(sender, args)
///////////////////////////////////////////////////////////////
{
/*
// args.parameters is an array with an element for each modified row
// The column name property does not need to have been specified in "setColumnExpressions"
// Note that dates can be specified as Javascript dates. These are converted on the server to SQL date values
*/
for (var i=0; i < args.parameters.length; i++)
args.parameters[i]["ModifiedDate"] = new Date();
}
</script>