|
-
Aug 17th, 2001, 12:09 AM
#1
Thread Starter
Addicted Member
Listview - Multiple Selected Rows help
Hi, I'm working on a way for a user to group up items in a database. I'm using a listview, but I was wondering if there might be a better way.. I'll probably run into many problems along the way, and here's the first one (besides trying to find a way to get the number of selected items without looping)..
This is what I want to happen..
I populated a listview with the contents of a database, Desc, Asset Number, Quantity.. I want the user to be able to select a groups of rows and combine them into one record in the database.. One thing is that the user can only select items either above or below a currently selected item.. What I tried doing was in the ItemClick event, try to test if the row above or the row below have been selected.. Problem is, when I use the CTRL key to select more than one row, the listview.SelectedItem.Index property is not valid.. How can I find the index of newly select row when other rows have already been selected?
Thanks
John
-
Aug 17th, 2001, 12:43 AM
#2
I think you HAVE to loop:
VB Code:
Dim i As Integer
' Ghost selected ListItem.
If ListView1.SelectedItem Is Nothing Then Exit Sub
For i = 1 To ListView1.ListItems.Count
If ListView1.ListItems(i).Selected = True Then
ListView1.ListItems(i).Ghosted = True
End If
Next i
And you could make the FullRow Select True to highlight all the subitems too.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|