I'm trying to add values, located in a ListView, inside a DataGridView. The strange behaviour is that VS skips the adding process from the Listview to the DataGridView, so the DGV remains empty. I said that the compiler skips this process because the commands written after the code I'm reporting are done. I've also tried to replicate this section of the software on a new project and it works properly. In the listbox there are only numbers and I verified, through a debug windows, that the Listview is not empty. Here is the code I'm using:
For Each item As ListViewItem In Form25.ListView1.Items
With item
Dim elemCorrente() As String = { .Text, .SubItems(1).Text}
Form2.DataGridView2.Rows.Add(elemCorrente)
End With
Next
Where do am I doing wrong? Thanks all are gonna help me. Best regards