Datacombo issue

  • Thread starter Thread starter Antonio Paglia
  • Start date Start date
A

Antonio Paglia

Hi people,

Dim rows as string = "item1;item2;item3....."
Combo.DropDownStyle = ComboBoxStyle.DropDownList
Combo.DataSource = rows.Split(";"c)
Combo.SelectedIndex = -1

The combo is placed inside an MDI Child form. When the form is showed, the
combobox allways apears with the first item selected.
What is wrong ???

Please, help me !!

TIA
 
Hi Antony

well ... i think it is not possible to have a 'DropDownList' style and no selected item (e.g. 'Combo.SelectedIndex=-1'). That's way the first available item is choosed automatically by the environment.

I suggest to put a 'neutral' item ('Please choose an item') at the top of the list and select it when the form is loaded. Then upon completion of whatever the action is validate the user's choice and alarm if no other selection is made ...
 
Back
Top