zoukankan      html  css  js  c++  java
  • DataGrid和GridView鼠标移动上面背景变色

    GridView鼠标移动背景变色,在RowDataBound事件中添加如下代码:

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

    DataGrid鼠标移动背景变色,在ItemDataBound中添加如下代码

        protected void DataGrid1_ItemDataBound(object sender, DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                e.Item.Attributes["onMouseOver"] = "javascript:c=this.style.backgroundColor;this.style.background='#B0E0E6';";  //current 粉蓝色 //--#6699ff 蓝色 #FFFF00 黄色 #FFFFE0 亮黄色
                e.Item.Attributes["onMouseOut"] = "javascript:this.style.background=c;";
            }
        }
  • 相关阅读:
    TSP-UK49687
    维度建模的基本原则
    差分约束系统
    随机过程初步
    随机过程——维纳过程
    Xilinx FPGA复位信号设计
    10 Row Abacus
    Python
    FX2LP与FPGA的简单批量回环
    DFT公式的一个简单示例
  • 原文地址:https://www.cnblogs.com/52net/p/2521329.html
Copyright © 2011-2022 走看看