Updating data in gridview
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.
When Cancel link is clicked on Grid View in edit mode, On Row Canceling Edit event will fire that will call Cancel Record method.
I will be using Sql objects directly into methods to keep the example simple and straight forward.
In practical scenario you should use your existing architecture to populate and update the data.
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.
Search for updating data in gridview:
Till now our Grid View is ready to be populated, now let’s write a method to populate the Grid View.