I am building a data entry form utilising the IsRequired property to validate the controls in a ValidationGroup.
Is it possible to clear all validation warnings on a form without fixing the root cause? I would like to "clean the slate" so to speak without fixing the data, perhaps something like Me.UltraValidator1.Reset().
For example, if the user encounters validation warnings they have two options 1) Fix the errors 2) Discard the changes. If the user chooses to discard the changes and open a new record I would like the form to be cleared of all validation warnings (return the form to the state before validation was called).
I have tried supressing the notifications by calling Me.UltraValidator1.Validate("Required", False, False) but this has not worked, the images are not cleared from the form.
It is possible to loop through the controls and change the validation settings, but I am hoping there is a more efficient method.
If the user is discarding changes, I would think you then roll back the values to whatever they were before the dialog session began, which are presumably valid. If you do that, and then call the Validate method, the error conditions will then be cleared.
Infragistics support have replied with the following: "Unfotunately there is no way to clear all validation warnings on a form i.e. something like Me.UltraValidator1.Reset()."
Does anyone have any suggestions on the "best practice" of programatically clearing validation warnings without fixing the root cause?
i.e. Validation warning is triggered when user tabs out of textbox. User decides to create create new record instead of saving the current record. In this scenario the validation warnings remain visible (as the new controls are blank for the new record). However, since this is a new record we EXPECT the controls to be blank, so I would like to suppress the warnings.
Any suggestions?