Asp net gridview rowupdating findcontrol

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.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.

This is too late in the sequence, occurring the Update button is clicked.

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.

A Grid View Command Event Args object is passed to the event-handling method, which enables you to determine the command name and command argument of the button clicked.

Grid View displays the values of a data source in a table where each column represents a field and each row represents a record.

Leave a Reply