Click here to Skip to main content
15,912,400 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
XML
<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:

C#
protected void selectrd_CheckedChanged(object sender, GridViewEditEventArgs e)

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

  }
Posted
Comments
Dholakiya Ankit 16-Jul-13 6:26am    
have u tried using in radio button onclick = "selectrd_CheckedChanged"
ashok_89 16-Jul-13 6:45am    
yup but i couldnt use gridvieweventrgs

1 solution

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
 
Share this answer
 
Comments
ashok_89 16-Jul-13 10:26am    
i changed it to edit1 no its not working

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900