Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Make Listbox retain original values + selected value

Status
Not open for further replies.

aradia926

MIS
Jul 11, 2005
29
US
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!
 
You'd have to use a client function to do this as the control will already have been rendered. I'd ask in the javascript forum...


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top