However, most of the real world cases call for validating the data being edited or deleted. Drag and drop an SQL Data Source control on the web form.There can be several approaches taken for validating data. For our example we are going to use Customers table of Northwind database. Open its smart tag and choose "Configure Data Source" option to start Configure Data Source wizard. NET Grid View Tips and Tricks series, this post shows how to cancel the Update and Delete operation in an ASP. To cancel an update and delete operation, we will make use of the Row Updating and Row Deleting events.The events are as described below: Row Updating - Occurs when a row's Update button is clicked, but before the Grid View control updates the row.This will lead to problems like "Grid View does not show updated values", "Grid View looses values changed by user". In your Page_load, this is typically only inside a block where you check to make sure that Page_Load is not being called during a post-back call. NET 2.0 Grid View control allows us to quickly edit and delete records.
Obviously the simplest method is to use Data Key Names on the Grid View and then you should have the data in your Grid View Update Event Args as part of e. (In the following example, I cast to a Check Box as I know I have a checkbox at the col Index You Are Interested In - you should cast to whatever control you have in that column).On the first step of the wizard click on "New Connection" button to open a dialog as shown in Figure 1.Enter the database details as per your setup and click on OK.You can not attach validation controls directly to these Text Boxes.We need to convert these Bound Fields to Template Fields.On the next step select Customer ID, Company Name, Contact Name and Country columns (Figure 2).