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");
                    //事件绑定
                }

  • 相关阅读:
    Java 基础巩固:装箱拆箱 你真的熟悉吗
    Java数据类型的转换:隐式(自动)转换与强制转换
    oozie学习笔记
    flume学习笔记
    sqoop学习笔记
    Oracle故障排查之oracle解决锁表问题
    zookerper安装部署
    hadoop HA架构安装部署(QJM HA)
    hadoop第一部分-安装、测试
    hadoop完全分布式安装部署-笔记
  • 原文地址:https://www.cnblogs.com/huangxuening/p/2723860.html
Copyright © 2011-2022 走看看