• asp.net gridview绑定ratiobutton 和ajax


      protected void RbIsManual_CheckedChanged(object sender, EventArgs e)
            {
                RadioButton rb = sender as RadioButton;
                if (rb != null)
                {
                    GridViewRow row = rb.Parent.Parent as GridViewRow;
                    Button confirm = (Button)row.FindControl("save");
                    confirm.Enabled = true;
                }
            }
    <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
              <ContentTemplate>
                  <asp:GridView ID="AerocraftsGridView" runat="server" AutoGenerateColumns="False" 
                      AllowPaging="True"  
                      BackColor="White" BorderColor="Silver" BorderStyle="Ridge" BorderWidth="1px" 
                      CellPadding="3" CellSpacing="1" GridLines="None"
    
                      onpageindexchanging="AerocraftsGridView_PageIndexChanging" 
                      onrowdatabound="AerocraftsGridView_RowDataBound" PageSize="20"
                      >
                      <AlternatingRowStyle BackColor="White" />
                      <Columns>
                          <asp:TemplateField HeaderText="型号名称" ItemStyle-Width="130px">
                             <ItemTemplate>
                             
                             </ItemTemplate>
                          </asp:TemplateField>
                          <asp:TemplateField HeaderText="型号">
                             <ItemTemplate>
                                 <asp:RadioButton ID="rbzy" runat="server"  Text="在研" GroupName="在研标示" 
                                     AutoPostBack="True" oncheckedchanged="RbInResearch_CheckedChanged"  />
                                 <asp:RadioButton ID="rbywc" runat="server" AutoPostBack="True" Text="已完成" 
                                     GroupName="在研标示" oncheckedchanged="RbIsComplete_CheckedChanged" />
                             </ItemTemplate>
                          </asp:TemplateField>
    
                          <asp:TemplateField HeaderText="形式">
                             <ItemTemplate>
                                 <asp:RadioButton ID="rbsd" runat="server" AutoPostBack="True" GroupName="Type" 
                                     Text="手动" oncheckedchanged="RbIsManual_CheckedChanged" />
                                 <asp:RadioButton ID="rbzd" runat="server" AutoPostBack="True" GroupName="Type" 
                                     Text="自动" oncheckedchanged="RbIsAutomatic_CheckedChanged" />
                                
                             </ItemTemplate>
                          </asp:TemplateField>
                          <asp:TemplateField HeaderText="操作">
                            <ItemTemplate>
                                <asp:Button ID="save" runat="server" CssClass="btn_2k3"  ForeColor="White" Height="23px" Width="77px"  Text="确  定" onclick="Save_Click"  Enabled="False" />
                            </ItemTemplate>
                          </asp:TemplateField>
                      </Columns>
                      <EditRowStyle BackColor="#2461BF" />
                      <EmptyDataTemplate>
                          对不起,数据为空!
                      </EmptyDataTemplate>
                      <AlternatingRowStyle BackColor="#E6F7FE" />
                      <HeaderStyle BackColor="#B5CAE7" Font-Bold="True" ForeColor="White" />
                      <RowStyle BackColor="#B5CAE7" ForeColor="#305A68" />
                      <FooterStyle BackColor="#B5CAE7" Font-Bold="True" ForeColor="White" />
                      <PagerStyle BackColor="#B5CAE7" ForeColor="White" HorizontalAlign="Center" />
                      <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                      <SortedAscendingCellStyle BackColor="#F5F7FB" />
                      <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                      <SortedDescendingCellStyle BackColor="#E9EBEF" />
                      <SortedDescendingHeaderStyle BackColor="#4870BE" />
                  </asp:GridView>
                  <br />
                      <asp:LinkButton ID="btnFirst" CommandArgument="first" OnClick="PagerButtonClick"
                                runat="server">首 页</asp:LinkButton>
                            <asp:LinkButton ID="btnPrev" CommandArgument="prev" OnClick="PagerButtonClick" runat="server">上一页</asp:LinkButton>
                            <asp:LinkButton ID="btnNext" CommandArgument="next" OnClick="PagerButtonClick" runat="server">下一页</asp:LinkButton>
                            <asp:LinkButton ID="btnLast" CommandArgument="last" OnClick="PagerButtonClick" runat="server">尾 页</asp:LinkButton>
                            <asp:Label ID="LblCurrentIndex" runat="server"></asp:Label>
                            <asp:Label ID="LblPageCount" runat="server"></asp:Label>
                            <asp:Label ID="LblRecordCount" runat="server"></asp:Label><br /><br />
                  <asp:Label ID="explain" runat="server" Text="(不可操作的是已纳入基线的型号)"></asp:Label>
              </ContentTemplate>
            </asp:UpdatePanel>
  • 相关阅读:
    JavaScript:Number 对象
    JavaScript:Math 对象
    杂项:引用资源列表
    小团队管理与大团队管理
    技术转管理
    【翻译+整理】.NET Core的介绍
    自己开发给自己用的个人知识管理工具【脑细胞】,源码提供
    关于【自证清白】
    这篇博客能让你戒烟——用程序员的思维来戒烟!
    如果我是博客园的产品经理【下】
  • 原文地址:https://www.cnblogs.com/liuxinls/p/3075902.html
Copyright © 2020-2023  润新知