zoukankan      html  css  js  c++  java
  • 根据Gridviwe某列的值显示不同效果 空格效果 背景色效果

    if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    DataRowView row = (DataRowView)e.Row.DataItem;//当前行的数据

                    //if (e.Row.Cells[1].Text.StartsWith("51"))某列以值开头的
                    if (e.Row.Cells[1].Text.Length == 4)

                        e.Row.Cells[2].Text = e.Row.Cells[2].Text;

                    if (e.Row.Cells[1].Text.Length == 6)

                        e.Row.Cells[2].Text = " " + e.Row.Cells[2].Text;

                    if (e.Row.Cells[1].Text.Length == 8)

                        e.Row.Cells[2].Text = "  " + e.Row.Cells[2].Text;

                    if (e.Row.Cells[1].Text.Length == 10)

                        e.Row.Cells[2].Text = "   " + e.Row.Cells[2].Text;
                    if (e.Row.Cells[1].Text.Length == 12)

                        e.Row.Cells[2].Text = "    " + e.Row.Cells[2].Text;


                    //光标效果
                    e.Row.Attributes.Add("onmouseover", "color = this.style.backgroundColor;this.style.backgroundColor='#6a6868';this.style.cursor= 'hand';this.title='双击查看详细信息.'");
                    e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=color");
                    //事件绑定
                }

  • 相关阅读:
    python+selenium初学者常见问题处理
    pycharm的这些配置,你都知道吗
    巧用浏览器F12调试器定位系统前后端bug
    dsu + lca
    indeed2017校招在线编程题(网测)三
    rolling hash
    ac自动机
    indeed 第二次笔试题
    vmware以及schlumberger题解
    2017 google Round C APAC Test 题解
  • 原文地址:https://www.cnblogs.com/huangxuening/p/2723860.html
Copyright © 2011-2022 走看看