Once the Framework Element is extracted, by type casting it to the ‘Text Box’ UI element, the value changed in the cell can be read.
Here ‘Salary’ and ‘Dept No’ are changed and updated into the selected ‘Employee’ object.
When the delete button is clicked, the row will be deleted from the database.
Now run the application, click on the update button in the row and select cell to be changed (in this example ‘Salary’ and ‘Dept No’ cells can be changed).
This code first searches the selected Employee row using LINQ.
After the row is found, the update operation is performed on it.
Based on the sender argument I am getting the reference of the Link Button that is clicked and with the Command Argument of the Link Button I am getting the ID of the record to be deleted.
After the delete query I am firing a select query and the rebinding the Grid View.
column which will act as custom column for delete functionality.
Net Grid View control in order to add new record to the database.
On the onclick event if the button the records are inserted into the SQL Server Database and the Grid View is updated You can view above I am simply getting the data from the textboxes in the Footer Row and then firing an update query along with the select query so that the ASP. The figure below displays the Edit and Update functionality.
Basically I have tried to make the normal Add (Insert), Edit, Update and delete functions in ASP.
Net Grid View simple and also combining the powers of ASP.