Asp net rowupdating example
The Grid View Update Event Args class has three important collections - Old Values, New Values and Keys.
If the country is null then we set Cancel property of Grid View Update Event Args class to true. NET 2.0 Grid View control allows us to quickly edit and delete records.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.This tells Grid View that the event handler should be cancelled.The New Values collection is read/write collection and in the second if condition we set the Country to India. You will find that the data is not accepted by the Grid View.
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".