Updating ComboBox DataSource

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an arraylist (arlNAMES) that is bing used as a datasource for a
combobox. When an item is selected in the combobox I want to remove it from
both the combobox and the arraylist. This doesn't work. DOes anyone know
why and how to fix it?

Dim intPOS As Integer = cboAdvanceResponse.SelectedIndex
cboAdvanceResponse.DataSource = Nothing
arlNAMES.RemoveAt(intPOS)
arlnames.TrimToSize
arlREF.RemoveAt(intPOS)
cboAdvanceResponse.DataSource = arlNAMES
 
If it is bound to the Array, you only have to remove it from the array and
it should remove itself from the ComboBox.

If removing it from the array does not remove it from the combobox, then you
need to have set up public events to update the combobox

OHM
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top