StrataFrame Forum

Value not updated if not lost focus

http://forum.strataframe.net/Topic9963.aspx

By Chan - 7/4/2007

Hi,

I faced problem of, if I enter some values to textbox, click save button without lost focus the vale would not updated to underlying datasource.



Any ideas?



Thank you
By Trent L. Taylor - 7/5/2007

You have to set the controls BIndingUpdateMode to OnPropertyChanged rather than OnValidate in order to have the underlying data source updated when the value is changed rather than when the control is validated.
By Alex Luyando - 4/8/2010

Trent L. Taylor (07/05/2007)
You have to set the controls BIndingUpdateMode to OnPropertyChanged rather than OnValidate in order to have the underlying data source updated when the value is changed rather than when the control is validated.




Hmmmm... but what if you need it to be OnValidate due to the issue discussed in Odd Textbox Behavior (http://forum.strataframe.net/Topic13601-7-1.aspx?Highlight=onvalidation)?
By Alex Luyando - 4/19/2010

Anybody?
By Charles R Hankey - 4/19/2010

Looks like the answer is right in the thread you cited. Subclass the sf textbox, add the code shown and try using that. (remember you can change the inheritance of the textboxes where needed by just hacking the form designer file.)
By Dustin Taylor - 4/20/2010

Yep, not understanding your issue here. The solution presented in that thread is to create a subclassed textbox if you don't want to handle OnValidate on every instance.  If you already have an inherited textbox and are running into odd behavior when using Trim(), then overrite the OnTextChanged event as Trent described in that thread instead of worring about OnValidate.