none
clear combobox issue RRS feed

  • Question

  •  

    Hi

     

    I have 2 combobox that work together. If I select combobox 1 the combobox 2 is filled with information from a database, I then select an item from combobox 2 and some more details is displayed in some textboxes. The thing is that when I have done that and select some other value from combobox 1 I need to fill combobox 2 once more with some other data based on the other selection. So I added combobox2.items.clear, but the previously selected item in combobox2 is still left in combobox2. How can I remove that?

     

     

    Wednesday, October 29, 2008 4:54 PM

Answers

  • Hi magmo,

     

    Just write combobox2.SelectedIndex = -1 before combobox2.items.Clear.

     

    If I am wrong, let me know.

     

     

    Thank You

     

    Best Regards

    Utkarsh Gajjar.

     

    Wednesday, October 29, 2008 4:59 PM

All replies

  • Hi magmo,

     

    Just write combobox2.SelectedIndex = -1 before combobox2.items.Clear.

     

    If I am wrong, let me know.

     

     

    Thank You

     

    Best Regards

    Utkarsh Gajjar.

     

    Wednesday, October 29, 2008 4:59 PM
  • Hi Utkarsh

     

    Excellent soultion, Thanks!

     

    Wednesday, October 29, 2008 6:13 PM
  •  

    You are welcome, glad to help you.

     

    Thank You

     

    Best Regards

    Utkarsh Gajjar.

    Wednesday, October 29, 2008 6:23 PM