Rowupdating in gridview not working
In my case this was happening because I was binding to a List of custom objects.
Note A common mistake that a lot of people do is that they perform a databind each and every-time the Page_Load method is called.
These properties will automatically render Edit, Update and Cancel buttons inside Grid View column.In the Page_Load event, you simply load your data from the database and bind it with the Grid View control as shown below: For brevity I am not storing connection string in the web.config and also not using any Data Access Component.Next event is the Grid View Row Editing event to give ASP. You need to set the Edit Index property of the Grid View with the New Edit Index property of the Grid View Edit Event Args class.If user clicks the Cancel button while Grid View is in editing mode, you need to Cancel the Editing process and also need to reset the Edit Index property to -1 in the Row Canceling Edit event of the Grid View control as shown below: The last step is to handle the Row Updating event to actually update the back end database.
To do this we first need to obtain the reference of the current row by using its index no as shown in the first line below.
Now I will show you the C# code behind file of the above ASP.