Gridview edit row updating
In this article, I am going to explain how to manipulate data using Grid View control.This article scope is limited to Updating and Deleting records using Grid View and I am not using any readymade Data controls for that but manually writing all event methods.
In the same way you can put any kind of Validation controls inside Edit Item Template to validate the form element while user will click Update link.
In this method again, I am getting the primary key value using Data Keys property of the Grid View and using it to delete the records from the database.
After successfully deleting records, again I am calling Bind Data() method to rebind the Grid View.
So I have to specify how I want them to appear in the normal view and edit view.
That’s why I have placed different templates like Item Template (for normal view) and Edit Item Template (for edit view).