Keeping listbox items without resetting them each time

G

Guest

I've searched the prior posting so I don't think I missed an answer fo rthis.
I want to select items in my listbox based on other control selections. But
when I set the SeelctedValue it resets the whole list box. I.e.
'add to team members selection
lstteammembers.SelectedValue = ddnames.SelectedValue

IS there a way to prevent this, the user might have already selected several
items, via shift or control, then they clear out when a control sets the
value???

Thanx.
 
G

Guest

I think I figured it out, I do this and it works!

'add coord to team members selection
Dim itmCoord As ListItem

For Each itmCoord In lstteammembers.Items
'Response.Write("intCoord = " & itmCoord.Value & "<br>")
If itmCoord.Value = ddconcerncord.SelectedValue Then
itmCoord.Selected = True
End If
Next

I found that if you find the item and set "Selected" to true then it won't
affect the other items that are selected.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top