Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Selecting an item in a combo box with code
It would appear from the Visual Studio help file that if I use the code:
[code] ComboBox1.SelectedIndex = index [/code]
That the combo box would display the item in it's list that coresponds to the number in 'index.' That doesn't seem to work.
I've also tried:
[code] ComboBox1.SelectedItem = strItem[/code]
[code] ComboBox1.Test = strItem[/code]
Where strItem is known to be a item in the combo box's list. They don't seem to work either.
Am I missing a step somewhere?
The combo box is to allow the user to select an item from the list, so it's set up to DropDownList mode. The list items are from a dataset. When I run the code I have, everything about the combo box works exactly as I'm expecting it to except for this one problem.
The reason I want this is the user can go back to here and edit their choice so I want it to default back to what they selected earlier.
0 · ·