Asp gridview rowupdating validation

While this exception can be gracefully handled as demonstrated in the previous tutorial, ideally the editing or inserting user interface would include validation controls to prevent a user from entering such invalid data in the first place.

In particular, our validation logic will: in action).

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.

To remedy this, we have three options: Statement (Click to view full-size image) With this change, the formatted price in the editing interface includes commas as the group separator and a period as the decimal separator, but leaves off the currency symbol.

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.

To achieve this, click on the Edit Columns and Edit Fields links in the Grid View and Details View's smart tags, respectively.

Leave a Reply