{
//将满足特定条件的行标为高亮
if (e.row.rowtype == datacontrolrowtype.datarow)//判定当前的行是否属于datarow类型的行
{
int money = convert.toint32(databinder.eval(e.row.dataitem, "money"));//取当前行的列值
if (money == 77)
e.row.backcolor = color.red;
//string customer = (string)databinder.eval(e.row.dataitem, "customer");
string customer = databinder.eval(e.row.dataitem, "customer").tostring();
if (customer == "sdf")
e.row.backcolor = color.red;
}
//加入鼠标滑过的高亮效果
if (e.row.rowtype == datacontrolrowtype.datarow)//判定当前的行是否属于datarow类型的行
{
//当鼠标放上去的时候 先保存当前行的背景颜色 并给附一颜色
e.row.attributes.add("onmouseover", "currentcolor=this.style.backgroundcolor;this.style.backgroundcolor=yellow,this.style.fontweight=;");
//当鼠标离开的时候 将背景颜色还原的以前的颜色
e.row.attributes.add("onmouseout", "this.style.backgroundcolor=currentcolor,this.style.fontweight=;");
}
//单击行改变行背景颜色
if (e.row.rowtype == datacontrolrowtype.datarow)
{
e.row.attributes.add("onclick","this.style.backgroundcolor=#99cc00; this.style.color=buttontext;this.style.cursor=default;");
}
文章整理:站长天空 网址:http://www.z6688.com/
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




