zoukankan      html  css  js  c++  java
  • gridview 鼠标经过变色函数

    /我们先设置当鼠标上去的时候他的背景色改变
            e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#ff6699'");
            //下面我们再设置当鼠标离开后背景色再还原
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c;");
            //为特定的数改变行样式这也是在这个事件里面,因为这个事件是在数据被绑定的时候执行的
            for (int i = 0; i < GridView1.Rows.Count; i++)
            { //为了对全部数据行都有用,我们使用循环
                string lbl = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "state"));//我们得取出行中state字段绑定的值,用他作为判断条件
                if (lbl == "BB")
                { //如果他的值等于BB,那么
                    e.Row.BackColor = Color.LimeGreen;//给当前行的背景色赋值,说心理话,微软这点没DW做得好,人家就是直观得好
                }
  • 相关阅读:
    mvc生成table
    JQ仿ebay右侧flash商品展示
    调查一下,EF的Bug?
    SpringCloud组件Zuul入门解析
    SpringCloud组件Ribbon入门解析
    FTO介绍
    算法网址收藏
    哈拂大学凌晨四点的景象
    【系统学习ES6】第二节:解构赋值
    MySQL高级
  • 原文地址:https://www.cnblogs.com/allanbolt/p/1489615.html
Copyright © 2011-2022 走看看