Home / datingsitesforteenagers net / Gridview rowupdating event in c net

Gridview rowupdating event in c net

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).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.Out of these events Row Updating and Row Deleting are possibly the most common ones.

Let's proceed further by validating on the server side.

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.

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.

734 comments

  1. Aug 24, 2006. For a while now I'm trying to figure out why my method, triggered by the GridView. RowUpdating event, doesn't work as all samples say it should do. All samples of course assume you're doing everything in your page, but I have to do everything in my code-behind, because on forehand I don't know.

Leave a Reply

Your email address will not be published. Required fields are marked *

*