protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
//如果当前行尾数据行
if (e.Row.RowType == DataControlRowType.DataRow)
{
//添加鼠标在当前行时的background-color属性
e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#EFF8FF';");
//鼠标离开当前行后
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
}
}
GridView行,指向时变色
最新推荐文章于 2024-02-04 02:38:35 发布