Home All Groups Group Topic Archive Search About

Best way to clear errorproviders?

Author
31 May 2006 8:47 PM
Tom
Just wondering what others were doing to clear the errorprovider? What
I mean is that, during processing of a windows form, I may turn on
(i.e. SetError) the errorprovider for various fields. Now, once I have
committed the data (or reset the form), I want to be able to 'clear'
all these flags before the user re-uses the form. Normally, I just run
a method (which I usually call ResetErrorProvider) that sets each
field's errorprovider to string.empty for each field I may have set the
errorprovider on.

Is there a 'better' or 'easier' way to do this? It's too bad that there
isn't an ErrorProvider.Clear method that simply clears every field's
error provider... or is there something like this somewhere?

Just curious... Thanks in advance.

Tom

--

Author
1 Jun 2006 2:02 AM
ewok66
have you tried errorprovider.clear?  It should clear all errors set with that
provider.
--
--ewok
MCSA+M,MCSE, MCSD, MCDBA,MCITP


Show quoteHide quote
"Tom" wrote:

> Just wondering what others were doing to clear the errorprovider? What
> I mean is that, during processing of a windows form, I may turn on
> (i.e. SetError) the errorprovider for various fields. Now, once I have
> committed the data (or reset the form), I want to be able to 'clear'
> all these flags before the user re-uses the form. Normally, I just run
> a method (which I usually call ResetErrorProvider) that sets each
> field's errorprovider to string.empty for each field I may have set the
> errorprovider on.
>
> Is there a 'better' or 'easier' way to do this? It's too bad that there
> isn't an ErrorProvider.Clear method that simply clears every field's
> error provider... or is there something like this somewhere?
>
> Just curious... Thanks in advance.
>
> Tom
>
> --
>
>
Author
5 Jun 2006 10:15 PM
Tom
ewok66 wrote:

> have you tried errorprovider.clear?  It should clear all errors set
> with that provider.

Ewok: Unfortunately, this must be a VS 2005 feature. I am using VS 2003
and there doesn't seem to be an ErrorProvider.Clear.

--