GridView鼠标效果001protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
    }
http://blog.csdn.net/wkjs/archive/2006/12/06/1432560.aspx


GridView鼠标移动变色 http://blog.csdn.net/hz/archive/2006/01/08/573371.aspx

在GridView的

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Attributes.Add("onMouseOver", "SetNewColor(this);");
            e.Row.Attributes.Add("onMouseOut", "SetOldColor(this);");
        }
    }

在页面中加入

<script language="javascript">
       var _oldColor;
       function SetNewColor(source)
       {
          _oldColor=source.style.backgroundColor;
          source.style.backgroundColor='#666666';
         
       }
       function SetOldColor(source)
       {
         source.style.backgroundColor=_oldColor;
       }
    </script>


 DataGrid行随鼠标变色 http://blog.csdn.net/chuqunpeng/archive/2006/04/30/698747.aspx

private void DGzf_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
 if (e.Item.ItemType!=ListItemType.Header)
 {
  e.Item.Attributes.Add( "onmouseout","this.style.backgroundColor=\""+e.Item.Style["BACKGROUND-COLOR"]+"\"");
  e.Item.Attributes.Add( "onmouseover","this.style.backgroundColor=\""+ "#EFF3F7"+"\"");
 }
}

相关文章:

  • 2022-01-11
  • 2022-12-23
  • 2022-01-20
  • 2021-12-31
  • 2021-08-12
  • 2021-12-18
  • 2021-12-29
猜你喜欢
  • 2021-11-02
  • 2022-12-23
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2022-01-14
相关资源
相似解决方案