I am sharing this because I see a lot of questions on the forums on how to get the value from the Grid View object, and I know how.As a beginner it's very tough and challenging to work with controls like a Grid View in ASP. Even I faced difficulties at the starting point of my career. Here, I am not going to explain about Grid View and other events in it, because there are a lot of good articles about that.
Follow this link for more details --While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference.
event is raised when a row's Edit button is clicked, but before the Grid View control enters edit mode.
This enables you to provide an event-handling method that performs a custom routine, such as canceling the edit operation, whenever this event occurs.
I am only going to show the different ways we can use code to take the value from Grid View.
First, we have to very be clear in our mind that there are mainly two ways of taking the cell value from the Grid View: This code is for taking the value apart from the Grid View events; that is, any common event using a sender object.