如果我們需要通過觸發事件得到數據行的信息,可以用腳本了來實現,下面是單擊數據行得到行信息的代碼:
function db(index)
{
var str = new String("");
var curTRObj = this.Rows[index].Control;
//var column=this.column.lengh;
for (i = 1; i <=this.Columns.length-1; i++)
{
if(curTRObj.cells[i].innerText == " ")
{
str += this.Columns[i].UniqueName + "-Null\t";
}
else
{
str += this.Columns[i].UniqueName + "-" + curTRObj.cells[i].innerText + "\t";
}
}
str+="\n";
confirm(str);
}