October 8th, 2009, 02:40 PM
Advanced combobox binding from code
Suppose I have a business object '`obj1`' that has property '`P`'.
Let's also assume that I have a list of business objects: '`List<BussObj> list`' and each BussObj object contains 2 properties: '`A`' and '`B`'.
This list is bound to combobox: `combobox.ItemsSource = list;`.
I would like to specify binding (in C# code) that would bind combobox.SelectedItem.B to my obj.P. How to do it?
I tried something like that but it does not work:
Binding bind= new Binding("B");
bind.Source = obj.P;
Thank you in advance for any help
Click Here to Expand Forum to Full Width