When Update link of the Grid View will be clicked (in edit mode), On Row Updating event will fire that will call Update Record method.
I have specified Data Key Names as Auto ID, the primary key of the database table.
Then I have several methods attached with following events Get video of hundreds of ASP. On Row Editing - Edit Record On Row Cancel Edit - Cancel Record On Row Updating - Update Record On Row Deleting - Delete Record As I set Auto Generate Columns property to false so I am going to manually write the fields name that I need to appear in the way I want.
In this method, I am specifying the Edit Index property of the Grid View to -1.
As there is no row at -1 position so Grid View will be shown in normal mode.
After that again, I am doing the same thing that I had done in Cancel Record method, I mean setting Edit Index property of the Grid View to -1 and rebinding the data again by calling Bind Data() method.