使用复选框更新行 [英] Updating a row using checkbox

查看:89
本文介绍了使用复选框更新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



iam使用一个网格,其中项目模板(第一个单选按钮在那里)如果我使用链接按钮而不是radiobutton,当我点击iam能够编辑为文本框属性,但如果我使用单选按钮,则该编辑选项不会出现;



aspx:

Hi ,
iam using an grid in which inside the item template(the first one in which radio button is there)if i use link button instead of radiobutton ,when i click on iam able to edit as the textbox apperars, but if i use the radio button,that editing option is not coming;

aspx:

<asp:GridView ID="grd" runat="server" OnRowEditing="selectrd_CheckedChanged"  AutoGenerateColumns="false" DataKeyNames="id">
             <Columns>
                 <asp:TemplateField HeaderText="edition">
                <ItemTemplate>
              <big>  <asp:RadioButton ID="rdnselect" runat="server"   CommndName="edit" /></big>

                </ItemTemplate>
                 </asp:TemplateField>
              <asp:BoundField HeaderText="ids" DataField="id" />
                 <asp:TemplateField HeaderText="password">
                     <ItemTemplate>
                         <%# Eval("pwd") %>
                     </ItemTemplate>
                     <EditItemTemplate>
                         <asp:TextBox ID="edits" runat="server" Text='<%# Eval("pwd") %>'></asp:TextBox>
                     </EditItemTemplate>
                 </asp:TemplateField>
             </Columns>




               </asp:GridView>





cs:





cs:

protected void selectrd_CheckedChanged(object sender, GridViewEditEventArgs e)

  {
      grd.SelectedIndex = e.NewEditIndex;
      ldgrid();

  }

推荐答案

hi




< asp:radiobutton id =rdnselectrunat =servercommndname =editxmlns:asp =#unknown>





commandname =edit改为其他名称,如 commandname =edit1,然后再次尝试编辑网格视图。因为这将是编辑未在gridview中触发的原因
hi

<asp:radiobutton id="rdnselect" runat="server" commndname="edit" xmlns:asp="#unknown">


change your commandname = "edit" into other name like commandname = "edit1" and try again to edit gridview. because it will be a reason for editing is not firing in gridview


这篇关于使用复选框更新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆