I'm using Visual Studio 2005 with VB.NET and have created a form with a multi-select enabled listbox control. The listbox's datasource is a table in sqlserver. The listbox is not databound. To determine which items from the datasource should be selected in the listbox, I created a dataset that queries the sql server database and loops through the listbox, selecting the appropriate items.
When I click on one of the items in the listbox, (whether previously selected or not) all items are unselected except for the one that was clicked.
From what I hear, the control was designed this way.
Also, from what I hear, you can work around this by somehow storing the selected items then referring to that when a user selects or un-selects an item and then update the list accordingly.
What I don't hear is how to do this.
I search all over and couldn't seem to find any definitive answers.
Does anybody know how to achieve this programmatically, without using a ctrl+click?
Thanks!
When I click on one of the items in the listbox, (whether previously selected or not) all items are unselected except for the one that was clicked.
From what I hear, the control was designed this way.
Also, from what I hear, you can work around this by somehow storing the selected items then referring to that when a user selects or un-selects an item and then update the list accordingly.
What I don't hear is how to do this.
I search all over and couldn't seem to find any definitive answers.
Does anybody know how to achieve this programmatically, without using a ctrl+click?
Thanks!