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.
On the first step of the wizard click on "New Connection" button to open a dialog as shown in Figure 1.
Make Company Name blank and click on Update button.
You should see an error message as shown in Figure 7.
By default when the Grid View controls goes in edit mode, it displays Text Boxes for entering values.
You can not attach validation controls directly to these Text Boxes.
This will display the template designer for the column as shown in Figure 6.
Next, drag and drop a Required Field Validation control below the Text Box.
Today was spent mostly tackling the Grid View’s Update/Edit functionality, and I got incredibly frustrated, at first. So be sure to rebind your Grid View at the end of your event handler. I’ve got a pretty good handle on it as I’ve been doing it for several years, and can help with a lot, but I definitely don’t claim to know everything. Finally, to pull your hidden value that you’ve dubbed a Data Key in the Grid View’s subroutine. Remember that my first column was a Hyper Link Field, so in order to pull that value, I must cast that column as a Hyper Link.Enter the database details as per your setup and click on OK.On the next step select Customer ID, Company Name, Contact Name and Country columns (Figure 2).