Value not updated if not lost focus


Author
Message
Chan
Chan
Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
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
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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.
Alex Luyando
Alex Luyando
StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)
Group: StrataFrame Users
Posts: 112, Visits: 1.2K
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)?

________________
_____/ Regards,
____/ al
Alex Luyando
Alex Luyando
StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)StrataFrame User (210 reputation)
Group: StrataFrame Users
Posts: 112, Visits: 1.2K
Anybody?

________________
_____/ Regards,
____/ al
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
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.)
Dustin Taylor
Dustin Taylor
StrataFrame Team Member (652 reputation)
Group: StrataFrame Users
Posts: 364, Visits: 771
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.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search