Gridview rowupdating cancel event
This could easily be caught in the Row Updated event and seemed a logical choice and initially seemed to work as expected – until one of those damn tester people got hold of it.
It was found that if the page was in a dirty state before any data in the Grid View was editted then clicking on the Edit link button would result in the ‘Unsaved Changes’ dialog being displayed.
Well by default when a Command Field is added to a Grid View there is no way of knowing – so you have to convert the field into a Template field instead.
With this code in place clicking on the Edit button sets the page in Edit mode and the ‘Unsaved Changes’ dialog is not displayed.
In this article I will explain how to edit master-detail form using Grid View and Details View control in ASP.
But we were not out of the wood quite yet – we still needed to wire the new functions into the rest of the code.
In data driven web sites, users are normally allowed to view data and administrators are allowed to add, edit or delete data.
In this tutorial I will show you how you can create an editable Grid View control for administrators to modify database records directly into the Grid View control.
This can be done in the Row Updated event which is fired when the user clicks the OK button of a row in Edit Mode.
So, how do I know that the Edit button will be called Link Button1?