Thanks to you, RiverGuy, I'm able to display the appropriate column but the row always defaults to the bottom one. I want to display the column of the ROW I click on. Will you please help me with this also?
This will return the ListViewItem which you clicked on. You might need to alter it to get it to work if you click somewhere else on the row, and not directly on the item.
The GetItemAt Function returns an Object of Type ListViewItem. The .Show Method of MessageBox accepts a String to display. Therefore, you need to pass a String to it. ListViewItems have various properties of a String Type. You need to use one of those properties to display. For example, to display the text in the second column, change your code to MessageBox.Show("You selected row " & Me.lvMOCApps.GetItemAt(e.X, e.Y).SubItems(1).Text)
On the same subject, Can you help me with the following objective?
For Each itm As ListViewItem In Me.lvDocList.SelectedItems
' I want to use the value inside of the 3rd column
' in this listview.
Something = itm.Text (instead of col 1 I want col 3)
Next
For Each itm As ListViewItem In lvIMGDocsRvcd.SelectedItems
With Me.SqlDeleteDocRcvdAdapter2.DeleteCommand
.Parameters("@ABR_ID").Value = Me.txtABR_ID.Text Works
.Parameters("@DateRcvd").Value = DateValue(itm.Text) Works
.Parameters("@IMGDOC_Code").Value = itm.SubItems(2).Text
The 3rd line doesn't work. Please help.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.