skip to content »

Gridview rowupdating event not handled

gridview rowupdating event not handled-81

As Figure 8 shows, a price value that includes the currency symbol such as $19.95 is considered invalid.The Compare Validator's Figure 8: An Asterisk Appears Next to the Textboxes with Invalid Input (Click to view full-size image) While the validation works as-is, the user has to manually remove the currency symbol when editing a record, which is not acceptable.

gridview rowupdating event not handled-66gridview rowupdating event not handled-53gridview rowupdating event not handled-73

If you attempt to omit the name or enter an invalid price value when editing a product, an asterisk appears next to the textbox.You can verify this by visiting this page through a browser.You'll find that the appearance and behavior of the Template Fields is identical to the experience when Bound Fields were used instead.When constructing data entry forms, it is important that users enter any required fields and that all provided inputs are legal, properly-formatted values.To help ensure that a user's inputs are valid, ASP.When editing a row in a Grid View or Details View, those Bound Fields that are not read-only are converted into textboxes, from which the end user can modify the existing data.

Similarly, when inserting a new record into a Details View control, those Bound Fields whose (the default) are rendered as empty textboxes, into which the user can provide the new record's field values.

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.

After setting these three properties of the Required Field Validator, your screen should look similar to Figure 7.

Likewise, Check Box Fields, which are disabled in the standard, read-only interface, are converted into enabled checkboxes in the editing and inserting interfaces.

While the default editing and inserting interfaces for the Bound Field and Check Box Field can be helpful, the interface lacks any sort of validation.

If a user makes a data entry mistake - such as omitting the (such as -50) an exception will be raised from within the depths of the application architecture.