Hi,
I have a form with some controls (UltraCheckEditors, UtraTextEditors, UltraComboEditors...) that are bounded to some properties, the problem that this properties are updated two times ( this is for all controls) one time when propertie is changed and another time after validating. controls are bounded in this way :
(Example)
ultraCheckIsExternal.DataBindings.Add("Checked", object, "IsExternal", false, DataSourceUpdateMode.OnPropertyChanged);
when IsExternal checkBox is checked/unchecked the IsExternal setter is called and when i move focus to another control the IsExternal setter is called again (no handlers for CheckChanged, Validating... ).
This behavior is for all controls in this form.
Best regards.
The way Binding in DotNet works is that the BindingManager determines when the property has changed by looking for an event that matches the name of the property. So in this case, you are binding the to Checked property, the BindingManager will use CheckedChanged to determine when the value has changed.
So try handling this event and see if it is firing twice. If it is, then this would be a bug in the UltraCheckEditor. If the event is not firing twice, then the BindingManager is calling the property setter twice for some reason outside the control of the UltraCheckEditor. I suspect it's the latter case.
Mike Saltzman"] the BindingManager will use CheckedChanged to determine when the value has changed.
the BindingManager will use CheckedChanged to determine when the value has changed.
Okay the BindingManager update the data source after CheckedChanged, but it update data source again after validating!!
Any way, I can prevent the second update by setting the CausesValidation to false but this also prevent the Validating event to be raised.
I don't think there is any way around that. The UltraCheckEditor itself has no control over it, it's all the BindingManager.