PDA

Click to See Complete Forum and Search --> : [RESOLVED] Detect/change row selected with ListView on CF20


easymoney
May 17th, 2007, 07:35 AM
I finally have all my data imported to my handheld and stored in a SqlCe db.

I have some records filtered and displayed in a ListView control in detail mode to create a simple table. When an item (row) in the listview is clicked, I need to open another form based on the value of the first column (Primary Key Id) on the selected row.

Maybe in the SelectedIndexChanged Event:

lvListView_SelectedIndexChanged

What is the proper method in CF20. I do not see a Click or DoubleClick event for the ListView control.

Also, is it possible to change the selected row with code to simulate a move previous or move next, etc...

Thanks. :blush:

petevick
May 17th, 2007, 10:00 AM
Hi,
use the selectedindexchanged event
Something like...

iSel = -1
If lvEnquiries.SelectedIndices.Count <= 0 Then
Exit Sub
End If


Try
Isel = lvEnquiries.SelectedIndices(0)
If Isel < 0 Then
Exit Sub
End If
Catch
End Try

Pete

easymoney
May 18th, 2007, 01:27 AM
Awesome :thumb:

I had the right event, just wasn't sure how to utilize the proper code. Excellent method. :wave: