Event rowupdating which
Last line of the following code is calling a local method for updating the database and passing all the parameters to this method.
Please keep in mind that there are many different ways to update the database using the Grid View control depending on the type of data you are updating and the functionality the user need and there are many solutions to achieve the same end result.
If we move our mouse on to the variables, which hold the cell values, we can see the old value instead of new updated value (Refer the debugging Screen Shot at the Top).
The visitors to a web site can typically be divided into two groups: the users and the administrators.
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.
NET page that will handle different Grid View events to provide complete editing functionality.
To get the Primary Key reference we can use the Data Keys collection of the Grid View.
This collection only requires the row index no and it will give us the primary key.
Instead, you can use the on Cell Click option to handle the event.
When implementing a handling function for this event, use the object passed to this function as its parameter.