Gridview rowupdating textbox empty Room cam chat america free

Posted by / 10-Apr-2015 02:43

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.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.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).This will display the template designer for the column as shown in Figure 6.This will convert them from Bound Field to Template Field.

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.

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.

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.

gridview rowupdating textbox empty-44gridview rowupdating textbox empty-77gridview rowupdating textbox empty-56

Here, we set the Data Source of the Grid View to Sql Data Source1. We also enable paging, sorting and editing features of the Grid View.