I have 2 Listviews, which both contain a list of names. For example :
Listview1
---------
Jon
Jim
Alan
Lee
Claire
Paul
ListView2
---------
Susan
James
Tony
Jon
Alan
What I'd like to do is compare the two listboxes, and if a name appears in both lists, I'd like to remove it from List2
I have the following code which populates the Listviews, and I assume I need to add something into the For...Next Loop, but I'm not sure what?
VB Code:
Dim aRow As DataRow Dim X As ListViewItem = Nothing For Each aRow In ds.Tables(0).Rows X = New ListViewItem(aRow.Item("Name").ToString, 0) Listview2.Items.AddRange(New ListViewItem() {X}) Next
Can anyone help please ?




Reply With Quote