Sunday, April 3, 2011

Do not want Error Provider to check control validation until save event

I am writing a User Control. Into each control I am loading a custom biz object. Because the biz object implements IDataErrorInfo interface I am able to use the ErrorProvider control on the user control.

I am binding the ErrorProvider to the biz object like this:

Me.ErrorProvider1.DataSource=MyBizObject

This is all working perfectly EXCEPT. The validation is happening (and therefore I am displaying the blinkey error signs next to all feilds) as soon as the User control is loaded into the host form.

Each biz object implements a SAVE method and I want the validate to not happen until the save event is triggered on the biz object.

What is best practice for accomplishing this??

Seth

From stackoverflow
  • I don't know if this was the best way or not...but what I did was not assign the ErrorProvider.DataSource UNTIL the Save Event for the control.

    This is working for now.

    Seth

0 comments:

Post a Comment