Gridview in edit mode, must save first before doing anything else?

Mago Alan

New Member
I have a gridview, at the moment users can go into edit mode on a particular record and then click to add another record without saving the record they first were editing.I have added the template field im using from the gridview and i have also added the rowcommand code. I was hoping to just run some validation, then somehow not let the edit/cancel/delete code to run?hope this makes sence\[code\]<asp:TemplateField ItemStyle-Width="35px"> <ItemTemplate> <asp:LinkButton ID="EditButton" ForeColor="Blue" Font-Size="Small" runat="server" CommandName="Edit" Text="Edit" /> <asp:LinkButton ID="DeleteButton" ForeColor="Blue" Font-Size="Small" runat="server" CommandName="Delete" Text="Delete" /> </ItemTemplate> <EditItemTemplate> <asp:LinkButton ID="UpdateButton" ForeColor="Blue" Font-Size="Small" runat="server" CommandName="Update" Text="Update" />&nbsp; <asp:LinkButton ID="Cancel" ForeColor="Blue" Font-Size="Small" runat="server" CommandName="Cancel" Text="Cancel" /> </EditItemTemplate> <FooterTemplate> <asp:LinkButton ID="linkAddObjective" CommandName="AddCareerAspirations" Font-Size="Small" ForeColor="blue" ValidationGroup="vCareerAspiration" runat="server">Add</asp:LinkButton> </FooterTemplate> </asp:TemplateField> protected void gridview_OnRowCommand(object sender, GridViewCommandEventArgs e) { Boolean bInEditingMode = false; if (e.CommandName.ToLower() != "update") { bInEditingMode = ValidateIfEditingMode(); } if(bInEditingMode==true) { //some how cancel the edit/update/delete happening? }\[/code\]
 
Back
Top