Home All Groups Group Topic Archive Search About

Stop datagrid causing validation

Author
12 Apr 2005 12:04 PM
Geoff Murley
I have a Datagrid with the first Column as Edit.  Clicking
on Edit displays the usual Update and Cancel
Links/Buttons.  However, after I click on Edit and then
change my data, when I click on Update the Link/Button
Causes Validation on 2 Empty Text boxes further down the
page which are used only for adding a new Row.  So how do
I prevent the Update Link/Button from Causing Validation
and firing the Required Field Validators on the textboxes?

Author
12 Apr 2005 3:46 PM
Brock Allen
You'll have to build your own TemplateColumn and add in those Edit/Cancel/Update
buttons yourself. On the Buttons add the CausesValidation=false property.
For the Buttons to work with the DataGrid you'll need to set their CommandName="Edit",
CommandName="Cancel" and CommandName="Update" so the grid knows that they
were clicked.

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> I have a Datagrid with the first Column as Edit.  Clicking on Edit
> displays the usual Update and Cancel Links/Buttons.  However, after I
> click on Edit and then change my data, when I click on Update the
> Link/Button Causes Validation on 2 Empty Text boxes further down the
> page which are used only for adding a new Row.  So how do I prevent
> the Update Link/Button from Causing Validation and firing the Required
> Field Validators on the textboxes?
>