Rowupdating command argument
You should see an error message as shown in Figure 7.
We will use the Custom Validator control for this purpose.These events are raised before updating and deleting the record respectively.In our example we will illustrate the use of Updating event for the validation purpose.We check the value entered in the Text Box using args. Especially the following events are important for validation point of view.Out of these events Row Updating and Row Deleting are possibly the most common ones.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.This will convert them from Bound Field to Template Field.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.Just like we attached the Required Field Validator control to the Text Box, attach a Custom Validator to the Contact Name column. If you run the web form and try entering wrong value in the Contact Name column then you will see the error message displayed as before and the value will not be accepted by the Grid View control.Set the Control To Validate and Error message properties to the appropriate values. Up till now we used the validation controls to validate Grid View input on client and server side.