Validating gridview

Click on the "Advanced" button and check the "Generate INSERT, UPDATE and DELETE statements" checkbox (Figure 3). Now that you have configured the SQL Data Source control let's bind it with a Grid View control. Open its smart tag and configure it as shown in Figure 4.

validating gridview-38validating gridview-77validating gridview-11

On the next step select Customer ID, Company Name, Contact Name and Country columns (Figure 2).

We are going through the following C# code to analyze the process of validating data in grid cell.

The C# code snippet will enable the data cell validation in a textbox column for entering only none empty strings, which will disable the data validation and display the error indicator at the row header.

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.

Leave a Reply