zoukankan      html  css  js  c++  java
  • 页面载入时通过获取GridView某行某列的值来控制某一列的控件属性

    通过获取状态来控制“查看”button的Visible属性值。


         

        在前台GridView中加入 OnRowDataBound="GridView1_RowDataBound“。例如以下:

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" AllowSorting="True"
                                        OnRowDataBound="GridView1_RowDataBound" BackColor="White">

      </asp:GridView>

    在后台 GridView1_RowDataBound 事件中对控件属性控制。例如以下:

     protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) 
            {
                          if (e.Row.Cells[4].Text == "县审核通过")
                    {
                        e.Row.Cells[11].Visible = false;   //设置当前选中行第11列为不可见
                    }

            }

  • 相关阅读:
    nginx编译安装
    使用scp命令,不同服务器之间拷备文件
    cpu负载过高排查与解决
    Docker安装
    sftp安装
    nginx登陆验证 [done]
    git常用命令
    python常见问题记录
    升级openssl
    rsync使用
  • 原文地址:https://www.cnblogs.com/yfceshi/p/7339803.html
Copyright © 2011-2022 走看看