Click here to Skip to main content
15,905,867 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends,
I have Template Field in Grid, I paste the code below

<asp:TemplateField HeaderText="Action">
                       <itemtemplate>
                           <asp:LinkButton runat="server" ID="linkEdit" Text="Edit"  CommandName="Edit" CommandArgument='<%# Eval("conditionid") %>' > |
                           <asp:LinkButton ID="lnkDelete" runat="server" CommandName="Delete" CssClass="delbutton" CommandArgument='<%#Eval("conditionid") %>'>Delete
                       </itemtemplate>
                       <edititemtemplate>
                           <asp:LinkButton runat="server" ID="linkCancel" Text="Cancel"  CommandName="Cancel" CommandArgument='<%# Eval("conditionid") %>' >
                       </edititemtemplate>


In action column there are two links Edit | Delete

When edit link is clicked the grid goes to edit mode, I do editing of record through the controls which are outside the gird. The gird only contains Cancel link, to cancel editing.

When I click SaveEdit button, the data gets update but the Cancel is not getting replaced by Edit | Delete

May I know where I'm going wrong?

Thanks in advance
Posted
Comments
Parwej Ahamad 9-Aug-11 1:58am    
Edit, Delete is a special command name which is used by Gridview so change the command name like DoEdit etc. Hope so will work.
dhage.prashant01 9-Aug-11 2:36am    
I don't think it will resolve this issue
Aswathi Narayan 24-Aug-11 2:45am    
Parwej Ahamad is correct. it cannot work when we use default command names

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