We need to convert these Bound Fields to Template Fields.
In order to do so select "Edit Columns..." from the smart tag of the Grid View. Select Company Name and Contact Name fields and click on "Covert this field into a Template Field" link.
Make Company Name blank and click on Update button.
You should see an error message as shown in Figure 7.
Out of these events Row Updating and Row Deleting are possibly the most common ones.
These events are raised before updating and deleting the record respectively.
Here, our validation criteria is that the entered name must not contain title of courtesy (Mr./Mrs./Ms.). That is when you can handle certain events of Grid View control.
We check the value entered in the Text Box using args. Especially the following events are important for validation point of view.
Now from the smart tag of the Grid View choose "Edit Template" and then select "Edit Item Template" of Company Name column.
Set the Control To Validate property of Required Field Validator control to Text Box1 (i.e. Also, set its Error Message property to "Please enter company name".
Note that by default all validation controls validate on the client side.
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).