Experts: this code moves highlighted items from a listview to a datagridview on a button click, however I need help converting the code so that duplicate items are not added to the datagridview. The items need to stay in listview, they cannot be removed to accomplish this.
For example if "Apple" already has been added to the datagridview from the listview, and the user tries to highlight Apple in the listview and button click to move it over to the datagridview the code should not allow it...so that the datagridview has only one occurrence of "Apple" in it.
Thank you very much for any help!
Private Sub addmsrBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addmsrBTN.Click
'COPY ITEMS FROM AVAILABLE MEASURES LISTVIEW ON LEFT TO IMPORT MEASURES DATAGRIDVIEW ON RIGHT EXCEPT FOR DUPLICATES VIA BUTTON CLICK
For Each item As ListViewItem In ListView1.SelectedItems
importcolumnsDGV.Rows.Add(item.SubItems.Cast(Of ListViewItem.ListViewSubItem)().[Select](Function(n) DirectCast(n.Text, Object)).ToArray())