protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        
if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Attributes.Add(
"onmouseover""c=this.style.backgroundColor;this.style.backgroundColor='#B9D3EE'");
            e.Row.Attributes.Add(
"onmouseout""this.style.backgroundColor=c");
        }
    }

 也可以利用JQUERY实现相关的功能

            //变色
            $("tr").filter(function(){
                
return $('td',this).length && !$('table',this).length
             }).css({ background:
"ffffff" }).hover(
                    
function(){$(this).css({background:"#C1DAD7"});},
                    
function(){$(this).css({background:"#ffffff"});}
             );

 实例代码

 

相关文章:

  • 2021-11-30
  • 2021-11-30
  • 2022-12-23
  • 1970-01-01
  • 2021-09-09
  • 2022-02-17
猜你喜欢
  • 2021-11-30
  • 2021-12-31
  • 2021-11-30
  • 2021-11-30
  • 2021-12-31
  • 2022-02-21
相关资源
相似解决方案