Problem with AddInstanceRule on BindingListBase child object

Problem with AddInstanceRule on BindingListBase child object

Old forum URL: forums.lhotka.net/forums/t/2673.aspx


boo posted on Tuesday, April 10, 2007

The child object has a customer business rule.  Now if I use the static AddRule method it gets called and everything is happy.  But if I use the AddInstanceRule method instead, if I change the value for the associated property the rule is never called.  There are other rules (CommonRules.StringRequired) that continue to fire, but those are AddRule calls.  Can you not mix AddRule with AddInstanceRules?

xal replied on Tuesday, April 10, 2007

There are two different overridable methods:
AddBusinessRules()
AddInstanceBusinessRules()

You should make AddRule calls in the first override and AddInstanceRule calls in the second.

Andrés

Copyright (c) Marimer LLC