Net gridview rowupdating
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.
Now from the smart tag of the Grid View choose "Edit Template" and then select "Edit Item Template" of Company Name column.
This will display the template designer for the column as shown in Figure 6.
In this post, I am going to explain how to enable in-place editing with validation control in a Grid View in ASP. Net webforms, mvc, winforms, c#.net, sql server, entity framework, Ajax, Jquery, web api, web service and more.
We need to convert these Bound Fields to Template Fields.
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).
As the values are inserted into an Ordered Dictionary - you can use the field names to access the changed data 2.
NET 2.0 Grid View control allows us to quickly edit and delete records.