New Posts New Posts RSS Feed: Set not firing when tabbing through field
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Set not firing when tabbing through field

 Post Reply Post Reply
Author
BrooksAdair View Drop Down
Newbie
Newbie


Joined: 08-Oct-2008
Location: South Florida
Posts: 14
Post Options Post Options   Quote BrooksAdair Quote  Post ReplyReply Direct Link To This Post Topic: Set not firing when tabbing through field
    Posted: 10-Mar-2009 at 8:36am
I have a field that is bound to a property that is mandatory depending on the value of other properties. I have a verifier attached to the property that determines when it should be mandatory.  The verifier works fine, but when the user tabs through the field without hitting a key, the setter is never called. If the user hits space, then back spaces, then tabs it will call the setter and the verifier will stop the user as needed.

How can I get the setter to always fire, even when the user makes no changes?
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 13-Mar-2009 at 8:03pm
Your best bet is to use an instance verifier instead of, or in addition to, the property level verification you're already doing.  When verification of a property is dependent on the values of other properties instance-level verification of the entire entity is usually preferable.
 
As for how to force the setter to fire, I really don't know.  The default DataSourceUpdateMode of the BindingDescriptors is "OnValidation", which means a change has to be made and the control exited before the setter is called.  The "OnPropertyChanged" mode, when set, means that any change typed into the control causes the setter to be called.  But there's no mode available to call the setter just when tabbing through.  You'd probably need to hook into control or form events to do something programmatically.  But, instance verification would probably be a much cleaner and easier approach.
Back to Top
BrooksAdair View Drop Down
Newbie
Newbie


Joined: 08-Oct-2008
Location: South Florida
Posts: 14
Post Options Post Options   Quote BrooksAdair Quote  Post ReplyReply Direct Link To This Post Posted: 16-Mar-2009 at 11:43am
Thanks for the information. I have instance verification in place already, but due to the flow of the screen I still need the property level verification to always fire. I will try directly calling verification for the property on the Leave event and see if that works.  
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down