Link to home
Start Free TrialLog in
Avatar of robertjmackay
robertjmackay

asked on

listview - clikc on row to retyrieve value of the selected item

Below is code that retrieves the text of the selected item.  
When I clik on another row, it bombs with an out of bounds error.  Through debug, i have learned that rmac_listview.selectedIndices.count = 0 after the second row is selected ... like its not recognizing the second row as being selected.  

I have tried this with multi-row selection on and off and it doesn;t seem to make a difference.

What I want to do is have the user double clik on a row, pickup a few values and launch a new form, only one row


Private Sub rmac_listview_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
rmac_listview.SelectedIndexChanged

Dim selected_counter = rmac_listview.SelectedIndices.Count
Dim selected_record = rmac_listview.SelectedIndices(0)
Dim temp = rmac_listview.Items(selected_record).Text

End Sub
ASKER CERTIFIED SOLUTION
Avatar of Howard Cantrell
Howard Cantrell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial