Modify field at gridview1 rowupdating event

If you attempt to omit the name or enter an invalid price value when editing a product, an asterisk appears next to the textbox.

modify field at gridview1 rowupdating event-79

There, select each of the Bound Fields and click the "Convert this field into a Template Field" link.

Figure 3: Convert Each of the Details View's and Grid View's Bound Fields Into Template Fields (Click to view full-size image) Converting a Bound Field into a Template Field through the Fields dialog box generates a Template Field that exhibits the same read-only, editing, and inserting interfaces as the Bound Field itself.

Template Fields, which were the topic of discussion in the Using Template Fields in the Grid View Control and Using Template Fields in the Details View Control tutorials, can consist of multiple templates defining separate interfaces for different row states.

The Template Field's to provide a more foolproof user interface.

For more information on the new validation control features in 2.0, refer to Dissecting the Validation Controls in ASP. From here, you can select which template to edit from the drop-down list.

Since we want to augment the editing interface, we need to add validation controls to the (Click to view full-size image) All validation controls work by validating the input of a single ASP. Therefore, we need to indicate that the Required Field Validator we just added should validate against the Text Box in the property value is also the text displayed by the validation control on invalid input.

Specifically, this tutorial takes the example created in the Examining the Events Associated with Inserting, Updating, and Deleting tutorial and augments the editing and inserting interfaces to include appropriate validation.

In the Examining the Events Associated with Inserting, Updating, and Deleting tutorial we created a page that listed the names and prices of the products in an editable Grid View.

To add validation controls to the editing and inserting interfaces, the Bound Fields used by the Details View and Grid View controls need to be converted into Template Fields.

Comments are closed.