Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit Databinding problem with combobox
2 replies. Latest Post by karlssonkatrin on June 29, 2009.
(0)
karlsson...
Member
1 points
77 Posts
06-29-2009 7:52 AM |
Hi,
I have one configuration object that contains a list of strings, representing a persons civilstatus:
married, divorced, singel etc.
I also have a person object that has a property CivilStatus of type string.
I want to populate the combobox with the values from the configuration object. This works fine, when I set the DataContext to this object in .cs and the ItemSource in xaml to the string list.
What I know want to accomplish is to set the selected Item to the Person objects property CivilStatus (even though the datacontext is set to the configuration object) and I want to reflect any changes in the combobox to the personobjects property Civilstatus.
Is this possible in SL3?
Regards Katrin
jay nana...
Contributor
3388 points
624 Posts
06-29-2009 9:11 AM |
Try to use INotifyPropertyChanged interface for your persons class. so upon propertychanged, the binding will automatically update the civilstatus as well.
06-29-2009 9:27 AM |
I have my classes generated from a service reference so I don't want to update them. I was hoping to use databinding in some way?