Handle rowupdating event
When I hit Update, the changes are not saved, and there is no error message. When I hit Update, the changes are not saved, and there is no error message. Then the page posts back, the text boxes go back to being labels and the new values are lost, and the Row Updating code never fires. Yes, I did put the breakpoint at the Row Updating line (and not in the function).
I put a breakpoint on the Row Updating event handler and found that the event is not fired. I put a breakpoint on the Row Updating event handler and found that the event is not fired. In the Row Editing function, the edit textboxes appear and I can get the "old" values Then the page renders, I edit the textboxes and hit Update.
There are similar questions on Stackoverflow and other websites, but I seem to miss something.
I have a Grid View bound to a Data Table which comes from a database.
My goal is to update the one row at the time with a button which is in the same row which calls the following Method.
protected void Tests To Be Done_Row Updating(object sender, Grid View Edit Event Args e) Sql Command command Z = new Sql Command(query, my Connection); command Z. Close(); Set Patient Test Grid(Session["PATID"], e); } At my first try I had a On Row Command with the Grid View Command Event Args at the code behind.
Enable View State isn't explicitly set, so it remains the default (true).
You should create your data source once (on the user's first visit) and store it into Session for later use, and only bind the Grid View to the data source when it is necessary to do so.I tried converting from the Command Field approach shown in the code above to explicit Image Buttons using click events instead of commands: Hi kehbee, For firing Row Updating event of Grid View you need to set Command Name="Update" in the update Image Button.For cancel button you also need to set Command Name="Cancel".I would recommend trying this out and starting a new thread in the .NET Forum so that other people can learn from the experience too. -Frinny You may need to turn off validation even if you are not validating anything.