BindingContext - Combobox issue
-
Introduction
I've got a combobox on my form which is bound to a complex data source (IList).
myCombobox.DataSource = myList;
myCombobox.DisplayMember = "LastName";
myCombobox.ValueMember = "person_id";The combobox itself is bound to a business object
myCombobox.DataBindings.Add("SelectedValue", myBusinessObjectInstance, "person_id");
So far so good. My combobox is filled with the provided Items and when I select an item inside the combobox the value get's updated in my
myBusinessObjectInstance
as expected.Problem
As far as I understand the
BindingContext
class it holds all bindings (controls) bound to the same data source instance, in my casemyBusinessObjectInstance
. But when I ask the form for theBindingContext
attached tomyBusinessObjectInstance
the combobox binding is missing. What do I miss? myMsg.BehindDaKeys = "Jerry Maguire";