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

  • 相关阅读:
    pureftp 超时 mlsd
    安卓相机调用适配
    解决多个界面重复共用同一组数据导致数据同步改变(实现数据的完全深拷贝)
    PHP反射API的使用、体会、说明
    c冒泡排序
    iOS开发常用的第三方类库
    修改按钮上图片的大小-iOS
    获取手机通讯录--ios
    根据搜素的字符串改变label包含该字符串的文字
    cell点击按钮崩的一种情况
  • 原文地址:https://www.cnblogs.com/huangxuening/p/2723860.html
Copyright © 2011-2022 走看看