Select Items in binded Listbox to a DataTable

  • Thread starter Thread starter Alex Simic
  • Start date Start date
A

Alex Simic

Dear all

I am very desperate with my problem and you might be probably my last
chances for this issue.

I have a listbox which is binded to a DataTable. I would like in the
program to select in this listbox some items.

I try to do this with following (of course much more profesional - but
let's keep it simple):

Me.ListBox.Items(4).Selected = True
Me.ListBox.Items(6).Selected = True
Me.ListBox.Items(8).Selected = True

This seems not to be working, since I receive the error message
===Public member "Selected" on type "DataRowView" not found.===

Please help me on how I can select and mark in the programm those
items. By the way Selectionmode is set To MultiExtended.

Alex
 
Try something along these lines...

With ListBox1
.SetSelected(0, True)
.SetSelected(2, True)
End With

Hope this helps.
 
Perfect, it works !
THANKS A LOT
Alex


Matt S said:
Try something along these lines...

With ListBox1
.SetSelected(0, True)
.SetSelected(2, True)
End With

Hope this helps.
 
Back
Top