.NET Framework Bookmark and Share   
 index > Windows Presentation Foundation (WPF) > Order of Bindings
 

Order of Bindings

I am making up a WPF application to handle PO's
you select the PO (Combobox)
Then the Vender is selected for the PO in another combobox. Then the Contact from the vender is Selected from a 3rd combobox.
The problem is when you select an PO the VenderComboBox.SelectedItem Binds to the PO.Vender. Then the VenderContactComboBox.ItemsSource Binds the data of the current PO.Vender.Contacts.
And Finnaly the VenderContactCombox binds is selectedItem to the PO.VenderContact property.

The problem is when I change the PO this whole thing is bound to, the VenderContactCombobox binds its ItemsSource to the new Vender.Contacts clearing the Selected VenderContact of the last PO making the value null.

Does anyone know how to Bind a Dynamic ItemsSource of a combobox without effecting the SelectedItem while the ItemsSource is Changing?
Or how to easily suspend bindings then resume?
(I did get this working by using a windows forms approach and not binding in XAML ut thought this would be good to know (if possible) for future development)

MiddleTommy
Set IsSynchronizedWithCurrentItem to false on the ComboBoxes. This happens when you bind to the same item source that has a Current object.
Bigsby, Lisboa, Portugal - O que for, quando for, é que será o que é... http://bigsby.eu
Bigsby
Hello MiddleTommy,

Does the suggestion from Bigsby work for you?

Good luck
Please mark the replies as answers if they help and unmark them if they provide no help
Hua Chen

You can use google to search for other answers

Custom Search

More Threads

• Possible bug: ListView acts strangely when down arrow key is held down
• WPF Performance Suite new version Working Set Analyzer not present?
• WPF Books - Sites with learing stuff
• Customize triangle in TreeView - how ?
• Severe Perfomance Issue - Recreatable
• List View height problem
• Progress Bar updates
• Adding Templates in XAML Richtextbox
• Serialize DependencyObject to Xaml
• Is it possible to make a "screenshot" of the viewport?