ListSubItems, as the name indicates, contains only the subitems, i.e. column 1 and higher.
To get the first column (column 0), use
Selected_ID = lvwShowUserLog.SelectedItem.Text
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Dear all,
by this line I'm getting the column x value of the ListView selected row.
Selected_ID = lvwShowUserLog.SelectedItem.ListSubItems(x).Text
The above code line works when x is not zero; in fact when I try to get the value of the first column (having index =0) of the selected row I get this error message:
With this line:
Selected_ID = lvwShowUserLog.SelectedItem.ListSubItems(0).Text
I should get the ID value which is 1: I’m doing something wrong?
Thanks
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
ListSubItems, as the name indicates, contains only the subitems, i.e. column 1 and higher.
To get the first column (column 0), use
Selected_ID = lvwShowUserLog.SelectedItem.Text