.net - Performing validation on a databound object after the property has been updated -


i have basic form controls databound object implementing inotifypropertychanged interface. add validation couple of properties dont want go through implementing idataerrorinfo sake of validating couple of properties.

i have created functions perform validation , return error message (if applicable) in object. call these functions form when relevant properties on object have changed, , setup errorprovider control in form error messages have been returned validation functions.

i have tried hooking event handlers validating , lostfocus events, these seem fire before object updated, , hence not validating correct data. when leave textbox, go in , leave again validation runs against correct data.

is there event can hook can call these validation functions after property on object has been updated? or better off implementing idataerrorinfo interface?

i'm not sure problem is, saying can't property set until control loses focus?

if so, need set binding update onpropertychanged instead of onvalidation.

binding onpropertychanged means binding updated immediately, while onvalidation updates underlying object when validation triggered (which controls when lose focus).


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -