ComboBox

  • Thread starter Thread starter Angelina
  • Start date Start date
A

Angelina

Hi,

i need help on coding for a conbo box.
What i want to do is place values in my second combo box
based on what has been selected in the first one.

where is the best place to code this?
If i place the code in the SelectedIndexChanged for the
first combo box the values will keep adding on to the
previously contained values of combobox2.

what can do to work around this?

Also, does selected_index property represent the value
that is currently selected for a combobox??
 
Hi Angelina,

Angelina said:
Hi,

i need help on coding for a conbo box.
What i want to do is place values in my second combo box
based on what has been selected in the first one.

where is the best place to code this?
If i place the code in the SelectedIndexChanged for the
first combo box the values will keep adding on to the
previously contained values of combobox2.

what can do to work around this?

You might invoke combobox2.Items.Clear() before filling new data.
You might also nest your method wihtin BeginUpdate/EndUpdate to make it
faster.
Also, does selected_index property represent the value
that is currently selected for a combobox??
No, it represents the index of Items collection.
You should use SelectedItem instead.
 

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