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
1878
Data binding update on UltraComboEditor
posted

Hi!

I'm using an UltraComboEditor that uses Data Binding to get an Id out of an underlying business object which is used to select appropriate item from the items list. If another item is selected in the combo the Id is changed in the business object via the data binding which is fine.

I handle the ValueChanged event of the UltraComboEditor since I have to update another property 'Name' on same business object. This business object implements the INotifyPropertyChanged interface i.e. when 'Name' is set event OnPropertyChanged("Name") is fired causing data binding to fetch all visible properties again. This causes also the UltraComboEditor to display the item associated with the Id from the business object which is the original one thus the selection can never be changed.

I found a solution which works but my feeling is that it is more a workaround. In the ValueChanged event handler of the UltraComboEditor I explicitely set the 'Id' before setting 'Name' I. What I don't like on this solution is that 'Id' is updated again through the data binding.

Comments are welcome,
  Wolfgang