On Row Deleting - can call registered event handlers" I couldnt figure out how to continue this thread, but the issues in it are related so i'm including it as a reference.
In my custom grid View control I cannot raise the Row Updated event.
You're accessing so many items without null checks that it could be any number of things. Are you sure all of the controls exist in the cells you're specifying?
event is raised when a row's Update button is clicked, but after the Grid View control updates the row.
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.
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.In this tutorial we are searching for our Text Box controls txt Product Name and txt Unit Price.To get the Primary Key reference we can use the Data Keys collection of the Grid View.For demonstration I have created a database (named Database.mdf) in which we have a table named tbl_Employee.
Save all or press "Ctrl S" and hit "F5" to run the page, the page will look as in the following image: Click on "Edit the Grid View", it will display Textboxes in each cell as in the following image: Edit the value(s) here and click on the Update link, it will update all the data or to remove it click on the "Delete" link above the image shown.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.