I have a multiselect list box on a Windows form (VS 2008) containing references to 35 different work stations. The end user can select any number of workstations in this listbox, then store those selections to a SQL table (this part is working fine).
The problem is getting those same workstations highlighted/selected when the user recalls that record from the database, in the event that there are addtions or changes. Here is the relevant code for the reload:
If lstChange.CurrentRow.Cells(6).Value <> "" Then
Dim strTemp As String = lstChange.CurrentRow.Cells(6).Value
For Each drv As DataRowView In lstWkStns.Items
If strTemp.Contains(drv(0) & "|") = True Then<br/> <strong>(THIS IS WHERE THE RELOAD CODE WOULD GO?)</strong>
End If
Next
End If
All the existing references are displayed in a DataGridView (identified as lstChange). The currently-selected work stations are contained in column 6 of the DataGridView, and if there is anything there, I want to application to flag all those workstations
in the listbox. I'm sure it is something brain-dead simple that I am just missing, or perhaps I am making this more complicated than necessary, but either way I am stumped on how to accomplish this seemingly simple task. Any help or guidance would
be greatly appreciated!
LDC