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

  • 相关阅读:
    09-2:跳台阶
    09:菲波那切数列
    08:旋转数组的最小值
    07:用两个栈实现队列
    06:重建二叉树
    05:从尾到头打印链表
    04:替换字符
    centos7安装Jenkins更改默认端口并配置Ldap服务器进行用户认证
    Jira配置openLdap服务器进行用户认证
    定时自动从FTP服务器取数据脚本
  • 原文地址:https://www.cnblogs.com/huangxuening/p/2723860.html
Copyright © 2011-2022 走看看