Click to See Complete Forum and Search --> : Conditional Validation in DataGrids


beacon-dartmouth
August 24th, 2004, 02:07 PM
I have an insert row in the footer of a DataGrid. I need to validate user data on each text box but only when the "Add Button" is clicked, otherwise empty textboxes will flag a warning preventing the user form even moving between pages.

I thought of using a custom validator and checking that the add button was clicked to submit the form, but I'm not sure as to the syntax to follow. Has anyone done any of this before??

MRutledge
August 25th, 2004, 03:56 PM
You could use a custom validator, or you could just put some checking code at the beginning of your Add button event function and if it meets the requirments move on else handle the error and tell the user.

beacon-dartmouth
August 25th, 2004, 07:43 PM
thanx for the tip. I ended up using 'causesValidation="false" with all the buttons I have for navigation and it worked fine this time. Regards, b-d