leeds2000
asked on
How to get data from selected in listview
I was using a listbox, code below
i changed to a listview, and now i need the numbers in the selected line and in column1 in a variable from the listview.
The question is, how do i get this number?
The code below is how i did it with a listbox, with that code you should understand what i mean :)
i changed to a listview, and now i need the numbers in the selected line and in column1 in a variable from the listview.
The question is, how do i get this number?
The code below is how i did it with a listbox, with that code you should understand what i mean :)
'Dim ordrevalg As String = Me.listordre.SelectedItem
ASKER
No, you dont understand, that code is the one i used, i have a listview box now, not a listbox
I need to get the first number in the listview box (column 1) that is selected.
So i need the same function for the listview box, so the code above illustrates on a listbox
The code was only there to show what i mean with a listbox, i need to do the same for a listview box as i did for the listbox
you follow?
I need to get the first number in the listview box (column 1) that is selected.
So i need the same function for the listview box, so the code above illustrates on a listbox
The code was only there to show what i mean with a listbox, i need to do the same for a listview box as i did for the listbox
you follow?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
No need, that was just what i needed, THANKS :)
You have to notice this: if Me.listordre.SelectedItems .Count = 0, then the line proposed will produce an exception, you have to check this first.
ASKER
Yes, i have it embedded in a try catch, this would capture any error :)
Dim ordregvalg as String = Me.listordre.SelectedItem.