Rowupdating event grid view

18 Nov

In short, you had to modify the product's value from 1 to 4.

Likewise, the simplified interface lacks any input validation that may be necessary when editing required fields or fields that must appear in a particular format (like dates or numbers).

First, we need to prepare the database table and stored procedure for gridview operations such as insert, update & delete a records, here I’m using sql server 2008 for all database activities, for this sample I have created the customer table and stored procedure for all mentioned gridview operations.

Create the customer table in your own test database using below table script and insert some records initially to load gridview with data.

That’s why I have placed different templates like Item Template (for normal view) and Edit Item Template (for edit view).

NET 2.0 introduced a number of new Web controls designed for accessing and modifying data. We then saw how the Grid View control can work in tandem with the Sql Data Source control to provide a simple web-based editing interface composed of textboxes for each data field.

From the Visual Studio Designer, the Grid View can be marked as editable by checking the "Enable Editing" checkbox in the Grid View's smart tag or by manually adding a Command Field to the Grid View whose event.

In general, gridview control is used to populate the data in tabular format from different datasources and basically it derived from webcontrol class.

Then I have several methods attached with following events Get video of hundreds of ASP. On Row Editing - Edit Record On Row Cancel Edit - Cancel Record On Row Updating - Update Record On Row Deleting - Delete Record As I set Auto Generate Columns property to false so I am going to manually write the fields name that I need to appear in the way I want.

So I have to specify how I want them to appear in the normal view and edit view.

Here we are not deleting a record permanently but using active flag column, make it inactive the record while doing the delete operation then make it active and get it whenever you want.

In this article, I am going to explain how to manipulate data using Grid View control.