zoukankan      html  css  js  c++  java
  • GridView中得到选中的某行的ID值

    //前台
     <asp:TemplateField HeaderText="ID">
                    <ItemTemplate>
                        <asp:Label ID="lblID" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>

    //后台
     for (int i = 0; i < this.GridView1.Rows.Count; i++)
                    {
                        bool isChecked = ((CheckBox)GridView1.Rows[i].FindControl("CB")).Checked;
                        if (isChecked)
                        {
                            ID = ((Label)GridView1.Rows[i].FindControl("lblID")).Text;
                        }
                    }

  • 相关阅读:
    Tree Grafting
    敌兵布阵
    畅通工程(并查集)
    The Suspects(并查集)
    Ubiquitous Religions(friends变形)
    Friends(采用树结构的非线性表编程)
    小球下落(二叉树)
    铁轨
    卡片游戏
    征服C指针
  • 原文地址:https://www.cnblogs.com/QiuJL/p/4524336.html
Copyright © 2011-2022 走看看