views:

33

answers:

1

I have a "User" screen where a User entity is bound. When it starts off as a new user, the values bound to the combobox is null so the combobox starts off blank and the works as intended. If I then click my "New User" button, any comboboxes that were switched from the empty null value to a value while still on the previous entity seems to completely lose their binding on the new User. Any comboboxes that were left initially Null before clicking "new" continue to operate correctly. After this my combobox is completely dead. Changing it's value will not make it's way back the the source, and when loading a new source the combobox is no longer selecting the right data.

Could this have something to do with the fact that my combobox has no blank row, once I select something I cannot empty it out again. I don't know if that could have anything to do with it, but I can't figure out how to allow for an empty row in the list of choices.

A: 

Once your binding does not match the ItemsSource content, it's hard to get things back on track. Take a look at this post where I show how to set up the ComboBox for async content loading. It's a great option when you're switching ItemsSource and SelectedItem bindings at the same time.

http://blogs.msdn.com/b/kylemc/archive/2010/06/18/combobox-sample-for-ria-services.aspx

Kyle McClellan