IDataErrorInfo - Custom ErrorProvider icon

IDataErrorInfo - Custom ErrorProvider icon

am 20.12.2006 17:44:00 von Naveen

Hi,
My business objects all inherit from a base CommonEntity, which implements
the IDataErrorInfo interface to catch databinding errors.
Everything works great and the flashy red error icons show up as expected on
my UI views if there is a validation error.
My question is: Is there a way to customize this icon???

Thanks.
Naveen.

RE: IDataErrorInfo - Custom ErrorProvider icon

am 21.12.2006 17:24:00 von PRSoCo

You can change the ErrorProvider's icon by setting it's Icon [1] property.

[1]
http://msdn2.microsoft.com/en-us/system.windows.forms.errorp rovider.icon.aspx

--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#


"Naveen" wrote:

> Hi,
> My business objects all inherit from a base CommonEntity, which implements
> the IDataErrorInfo interface to catch databinding errors.
> Everything works great and the flashy red error icons show up as expected on
> my UI views if there is a validation error.
> My question is: Is there a way to customize this icon???
>
> Thanks.
> Naveen.

RE: IDataErrorInfo - Custom ErrorProvider icon

am 22.12.2006 21:54:01 von Naveen

I tried setting a new custom ErrorProvider in my form constructor and setting
it's DataSource to my object. It behaves correctly on validation errors but
the problem is that the default flashing red provider icon ALSO shows up
resulting in 2 error providers. This can be seen if I set the location of the
new error provider to the left of the control. This results in my custom
error provider showing up on the left of the control and the default error
provider on the right of the control. All I am trying to do is not show the
default error provider.

On a related note, is the default ErrorProvider accessible somehow in code?

Thanks.

"Peter Ritchie [C# MVP]" wrote:

> You can change the ErrorProvider's icon by setting it's Icon [1] property.
>
> [1]
> http://msdn2.microsoft.com/en-us/system.windows.forms.errorp rovider.icon.aspx
>
> --
> Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
> http://www.peterRitchie.com/blog/
> Microsoft MVP, Visual Developer - Visual C#
>
>
> "Naveen" wrote:
>
> > Hi,
> > My business objects all inherit from a base CommonEntity, which implements
> > the IDataErrorInfo interface to catch databinding errors.
> > Everything works great and the flashy red error icons show up as expected on
> > my UI views if there is a validation error.
> > My question is: Is there a way to customize this icon???
> >
> > Thanks.
> > Naveen.