Updating gridview row
For this situation, many developers use invisible columns (Hidden columns) in the gridview to identify that row. We can achieve the same functionality using Datakeys. Now I have declared a Grid View Row variable named row and stored the current row being edited into it.With the help row variable, I am going to find all the controls placed under that row in edit mode using Find Control property.
In this article, I am going to explain how to manipulate data using Grid View control.
As there is no row at -1 position so Grid View will be shown in normal mode.
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.
In practical scenario you should use your existing architecture to populate and update the data.
In this article, I am going to take a simple database table that has following fields: Auto ID - Int, Auto Increment, Primary Key Page Name - Varchar(50) Page Description - Varchar(500) Active - Bit(1) In this article, I am not going to explain the workings of Sql objects but focusing on the events and methods of the Grid View that will help us in updating and deleting the records.
Search for updating gridview row:
When Delete link of the Grid View will be clicked, it will confirm the user whether they really want to Delete the record, if they will click OK, it will fire On Row Deleting event of the Grid View that will call Delete Record method.