event is raised when a row's Delete button is clicked, but before the Grid View control deletes the row.
This enables you to provide an event-handling method that performs a custom routine, such as canceling the delete operation, whenever this event occurs.
This enables you to provide an event-handling method that performs a custom routine whenever this event occurs.
In case of the bound field’s we need to check what column it is and need to use index of that cloumn, which is little hard and even in future if we change the column order If you see the Last Template Field part in the above code, I am using the link buttons for edit, update, delete and cancel.
May be you may think why am I using link buttons as we are provided with some command field buttons by Grid View.
By default all the boundfields will be trasferred as Textboxes in Edit Mode.
To avoid this we need to keep the property Read Only as false, Then in the edit mode nothing will happenes. The reason I use Template Field instead of Bound Field is that, it is very easy to grab those controls in the codebehind if we user labels or textboxes.