Once we have the row, we can find all the Text Boxes and Drop Down List we had into the Edit Template. NET to execute the Udpate SQL statement and updated the reocord in database.
Once the record is updated, we need to again set the Edit Index of the Grid View to -1 so that no record is set in the Edit mode and then re-populate the data so that updated records are displayed in the Grid View.
In the Row Updating event handler, it fetches the Category Name data to which the textbox is bound to. Try something the gridview is bound to in your case Product [email protected] Vijay : I agree that its bad idea to enable any Id to be editable, but before going to my module i just create one table containing Prod ID and prod Name.
Note: Instead of using Text Box in normal mode use Labels.
The first column of this Grid View is the "Edit" column and the last column is the "Delete" column.
In this example, you can perform various operations in a grid, including sorting, grouping and filtering.This example shows how to edit and update records in a Grid View in ASP. This example is helpful in situations where an administrator needs to edit several records from the database.For demonstration I have created a database (named Database.mdf) in which we have a table named tbl_Employee.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). Data Grid Example " data-medium-file="https://jwcooney.files.wordpress.com/2013/09/gridviewexample.gif? Sometimes using Web Forms controls is not well documented and unintuitive, which is the case with the event, where a lot of information available online is incorrect or misleading. If they do (or if they don’t), then please leave a comment.