Row Deleting – Occurs when a row's Delete button is clicked, but before the Grid View control deletes the row.
Here’s the code to cancel update and delete in a Grid View: Suprotim Agarwal, ASP.
Connection string must be based on your database details. Drag the gridview control from tool box and placed into the page and make it Autogeneratecolumns as false, so manually we will create the gridview columns to display.
A datakey represents the primary key field or field of a record that can uniquely identify it in a data-bound control. Row Index represents the index of the particular row.
Many a times in our applications we use primary keys to get control of the particular record in the gridview.
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.
NET Grid View Tips and Tricks series, this post shows how to cancel the Update and Delete operation in an ASP. To cancel an update and delete operation, we will make use of the Row Updating and Row Deleting events.