-
October 8th, 2009, 01:40 PM
#1
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;
comboSubject.SetBinding(ComboBox.SelectedItemProperty, bind);
Thank you in advance for any help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|