Rowupdating in gridview in c net
In this tutorial I will show you how you can create an editable Grid View control for administrators to modify database records directly into the Grid View control.Editing the Grid View control can be an incredibly easy feature to add for certain database tables, especially those who have no foreign key associated and can easily be edited through the use of a standard Text Box web control as shown in the figure below: 1. Every one can use it to compare the new value with old ones.After searching long and hard I found a great article that solved my issue.
You'll be able to ask questions about coding or chat with the community and help others.
A Grid View Update Event Args object is passed to the event-handling method, which enables you to determine the index of the current row and to indicate that the update operation should be canceled.
To cancel the update operation, set the collections, if necessary, before the values are passed to the data source.
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.