A
Andrew
I have created a Component called a BOConnector that implements IBindingList
so it can provide access to a list of business objects to be bound to
controls.
At design time there is no live list of objects so BOConnector creates an
internal list of one object. It needs one object because when you bind to a
grid etc at design time it needs to get a list of properties to make the
columns.
My BOConnector works just fine with grids and simple controls like edit
boxes but I have a problem with the ListBox and ComboBox.
When I connect the BOConnector to the ListBox.DataSource it seems to create
a copy of the internal business object and try to save it into its
ListBox.Items in the form definition. I seem to see what is going on here,
it is taking a copy of the data and loading it into its Items. But why is
it doing this at design time? And the complex nature of my business object
means this messes up the form totally.
My first thought is to create a descendant of the ListBox and ComboBox and
make sure it does not copy items from the DataSource to the Items list at
design time.
Has anyone got any ideas?
so it can provide access to a list of business objects to be bound to
controls.
At design time there is no live list of objects so BOConnector creates an
internal list of one object. It needs one object because when you bind to a
grid etc at design time it needs to get a list of properties to make the
columns.
My BOConnector works just fine with grids and simple controls like edit
boxes but I have a problem with the ListBox and ComboBox.
When I connect the BOConnector to the ListBox.DataSource it seems to create
a copy of the internal business object and try to save it into its
ListBox.Items in the form definition. I seem to see what is going on here,
it is taking a copy of the data and loading it into its Items. But why is
it doing this at design time? And the complex nature of my business object
means this messes up the form totally.
My first thought is to create a descendant of the ListBox and ComboBox and
make sure it does not copy items from the DataSource to the Items list at
design time.
Has anyone got any ideas?