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做得好,人家就是直观得好
                }
  • 相关阅读:
    《一个人的村庄》 ——刘亮程
    uva 11020
    Codeforces Round #190 (Div. 2) B. Ciel and Flowers
    hdu3308 线段树——区间合并
    线段树,区间更新
    vim 被墙
    ubuntu12.04 修复Grub2
    windows下mysql数据库忘记密码
    高性能的异步爬虫
    中间件
  • 原文地址:https://www.cnblogs.com/allanbolt/p/1489708.html
Copyright © 2011-2022 走看看