Asp net 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.
The below is my connection string which is stored in web.config file.
In this tutorial we are searching for our Text Box controls txt Product Name and txt Unit Price.
I am using Template Field’s Item Template and Edit Item Template for providing read only and editing interface of the same column in the Grid View.
By Default, Grid View control displays Item Template which directly shows the Product Name and Unit Price columns but when user clicks Edit button Grid View automatically switches to Edit Item Template and display the control available inside Edit Item Template for user editing.
In the above tutorial I tried to give you one of the easiest solutions and I hope you can go explore Grid View control editing further after learning the basics from this tutorial.
In the Row Updating event I cannot gain access to any identifier that will enable me to start getting the updated values, update my object and persist it back to the database.