Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
355
Databinding problems, update is fired two times.
posted

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.

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi,

    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.

Children