zoukankan      html  css  js  c++  java
  • CheckBox全选/全消设置和GridView自增序号

    <script language="javascript" type="text/javascript">
     function CheckAllSelect()
     {
      var iRowCount=<%=grvApply.Rows.Count%>;
      
      var isCheckked = document.all.chkAllSelect.checked;
      
      for(i= 1;i<=iRowCount;i++ )
      {
       if(typeof(document.all.grvApply.rows(i).cells(0).children(0)) == "object")
       {                                                                      
        document.all.grvApply.rows(i).cells(0).children(0).checked = isCheckked;   
       }
      }
     }
    </script>


    <asp:GridView ID="grvApply" runat="server" SkinID="AlarmSkin" AutoGenerateColumns="False" OnRowDataBound="grvApply_RowDataBound" OnSelectedIndexChanging="grvApply_SelectedIndexChanging">
     <Columns>
      <asp:TemplateField HeaderText="&lt;input type='checkbox' id='chkAllSelect' title='全选/全消' onClick='CheckAllSelect();' &gt;">
       <ItemTemplate>
        <asp:CheckBox ID="chkBoxSelect" runat="server" />
       </ItemTemplate>
       <ItemStyle Width="20px" />
      </asp:TemplateField>
      <asp:TemplateField HeaderText="序号">
       <ItemTemplate>
        <asp:Label ID="Label1" runat="server" Text="<%# Container.DataItemIndex + 1%> "></asp:Label>
       </ItemTemplate>
       <ItemStyle Width="30px" />
      </asp:TemplateField>
      <asp:BoundField DataField="UserCode" HeaderText="用户名" />
      <asp:BoundField DataField="CourCode" HeaderText="课程编号" />
      <asp:BoundField DataField="CourName" HeaderText="课程名" />
      <asp:BoundField DataField="ApplyDate" HeaderText="申请日期" />
      <asp:BoundField DataField="ApplyStatus" HeaderText="申请状态" />
      <asp:TemplateField HeaderText="操作">
       <ItemTemplate>
        <asp:LinkButton ID="lblAccept" runat="server" CommandName="Select">受理</asp:LinkButton>
       </ItemTemplate>
      </asp:TemplateField>
     </Columns>
    </asp:GridView>
  • 相关阅读:
    python中的编码问题
    CVPR2018 Tutorial 之 Visual Recognition and Beyond
    hdu 1376 Octal Fractions
    hdu 1329 Hanoi Tower Troubles Again!
    hdu 1309 Loansome Car Buyer
    hdu 1333 Smith Numbers
    hdu 1288 Hat's Tea
    hdu 1284 钱币兑换问题
    hdu 1275 两车追及或相遇问题
    hdu 1270 小希的数表
  • 原文地址:https://www.cnblogs.com/zhangpengshou/p/953473.html
Copyright © 2011-2022 走看看