tags:

views:

37

answers:

1

Hi,

How to bind a iList item to a combobox through codebehind.cs file. plz explain with simple steps.

i need the steps for two way binding. not by setting itemssource.

yes, some thing like "myComboBox.SetBinding( ItemsControl.ItemsSourceProperty, new Binding { Source = myList });" but i need selected item also

Thanks,

+2  A: 

Do you mean something like this?

myComboBox.SetBinding(
   ItemsControl.ItemsSourceProperty, 
   new Binding { Source = myList });

myComboBox.SetBinding(
   Selector.SelectedItemProperty,
   new Binding { Source = mySelectedItemSource, Path = "SelectedItem" });
Samuel Jack