if (e.Row.RowType == DataControlRowType.DataRow) { // 当鼠标停留时更改背景色 e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor=‘#8EC26F‘"); // 当鼠标移开时还原背景色 e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c"); // 设置悬浮鼠标指针形状为"小手" e.Row.Attributes["style"] = "Cursor:hand"; }
Asp.net中GridView 当鼠标停留时更改所在行背景色
原文:https://www.cnblogs.com/sgxw/p/14749727.html