I update from 1.4.50 to 1.4.80 today and have some problem with numericUpDown on some CRUD forms.
When edit with keyboard a numericUpDown value binding to a bindingsource and without lost focus press a toolbox button with bindingsource.EndEdit() code in Click Event, the underlying datasource don’t show the change.
Using mouse wheel or + – buttons works ok.
Using Wisej 1.4.50 works ok.
Using OK code into button (no toolbox button) works ok.
See sample proyect attached.
Thanks in advance,
Attached sample, anyway this.validate() solved the accelerator problem.
Thanks. The problem is that there was a bug in the toolbar that causes the control with the focus to lose the focus when clicking a button in the toolbar, which then in turn caused the Validating events on the control losing the focus, which activated the data binding. That has been fixed so the toolbar buttons do not steal the focus and do not cause validation.
Data binding can get updated in three ways: Never, OnPropertyChange or OnValidation. See DataSourceUpdateMode, it’s the last optional argument in new Binding(). The default is OnValidation.
We also added CausesValidation to the toolbar. So you can either change the binding to OnPropertyChange which will update the data source on each Value change, or set this.toolbar1.CausesValidation = true, which will validate when you press Ok without stealing the focus.
There is also a different behavior (which is identical to WinForms – but I think we probably want to change it) between modal dialogs and forms – modal dialogs do not trigger validation when closed and close even if a field fails validation, while forms always validate the active control and refuse to close if validation fails.
Please login first to submit.