Weird ComboBox behaviour

  • Thread starter Thread starter Marius Horak
  • Start date Start date
M

Marius Horak

I have 5 combo boxes, each has the same ArrayList as DataSource.
When SelectedItem of one combo box changes other combo boxes change
their SelectedItem as well.

There are no events attached to any of the combo boxes.


MH
 
That is the expected behavior. All comboboxes share one currency
manager.

You need to have different currency managers for each combobox. I'm
not sure the best way to solve this, but one that should work is
(untested code):

Dim bindSource as BindingSource

bindSource = New BindingSource
bindSource.DataSource = myArrayList
combobox1.DataSource = bindSource

bindSource = New BindingSource
bindSource.DataSource = MyArrayList
combobox2.DataSource = bindSource

etc.
 
Jack said:
That is the expected behavior. All comboboxes share one currency
manager.

You need to have different currency managers for each combobox. I'm
not sure the best way to solve this, but one that should work is
(untested code):

Dim bindSource as BindingSource

bindSource = New BindingSource
bindSource.DataSource = myArrayList
combobox1.DataSource = bindSource

bindSource = New BindingSource
bindSource.DataSource = MyArrayList
combobox2.DataSource = bindSource

Thanks. I discovered this 5 minutes after my original post.
And I decided to share my discovery here so I made another post.
And guess what? It got censored and never appeared here.
OK, I used a four letter word, something like "5hit", but this is a
normal word that MS Word accepts.

MH
 
Jack said:
You need to have different currency managers for each combobox. I'm
not sure the best way to solve this, but one that should work is
(untested code):

Dim bindSource as BindingSource

bindSource = New BindingSource
bindSource.DataSource = myArrayList
combobox1.DataSource = bindSource


It works.

MH
 
Back
Top