var prevselitem=null;
//调用示例:在RowDataBound事件中加上如下代码
/*
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "if(this!=prevselitem){this.style.backgroundColor='#Efefef'}");//当鼠标停留时更改背景色
e.Row.Attributes.Add("onmouseout", "if(this!=prevselitem){this.style.backgroundColor='#ffffff'}");//当鼠标移开时还原背景色
e.Row.Attributes.Add("onclick", e.Row.ClientID.ToString() + ".checked=true;selectx(this)");
}
*/
function selectx(row)
{
if(prevselitem!=null)
{
prevselitem.style.backgroundColor='#ffffff';
}
row.style.backgroundColor='PeachPuff';
prevselitem=row;
var chkColl=row.all;
for(var i=0;i<chkColl.length;i++)
{
if(chkColl[i].type=="checkbox" )
{//alert(23);
if( chkColl[i].checked!=true)
{
chkColl[i].checked=true;
}
else
{
chkColl[i].checked=false;
}
chkItem_Click(chkColl[i]); //引发CheckBoxGv_list.js中的方法
}
}
}