我想要实现当鼠标划过gridview的行时,该行的字体能够变色,因为这行是超链接列,鼠标划过时还要能看到该列的下划线,鼠标移走时字体恢复以前的颜色,并且也看不到下划线了,请大家指点一下啊!

解决方案 »

  1.   

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if ((e.Row.RowType == DataControlRowType.DataRow))
            {
                //e.Row.Cells[1].Visible = false;            //变色
                e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#FFC080'");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#ffffff'");
            }
        }