|
-
Jan 3rd, 2006, 02:39 PM
#1
[RESOLVED] Listview with checkboxes and multiselect
I have a listview that I want to allow multiselect on. This listview also has checkboxes, and when you select an item, and then select another as well (multiselect) it checks the previous item (or items).
I don't want this functionality, but I don't see a way to turn it off.
I only want the checkboxes to be checked/unchecked by user clicking.. not by multiselecting.
Has anyone tackled this before? I am currently trying to devise a way by trapping the shift and ctrl keys when selecting to deselect any items that become checked, but this seems rather cumbersome
-
Jan 3rd, 2006, 02:46 PM
#2
Re: Listview with checkboxes and multiselect
Mine doesn't do that.
Even with OneClick on. What other options do you have selected? Which view?
etc
zaza
-
Jan 3rd, 2006, 02:48 PM
#3
Re: Listview with checkboxes and multiselect
what version are you running?
-
Jan 3rd, 2006, 03:03 PM
#4
Re: Listview with checkboxes and multiselect
ok i'm not sure how you're doing it??? but let me see if i can get a handle for what you're doing... are you saying that if you hold the shift key down and have multiple items selected then you click one of the multiple items it selected all selected items??? because that's the only way i've had the problem
-
Jan 3rd, 2006, 03:18 PM
#5
Re: Listview with checkboxes and multiselect
No, what was happening was this:
I have a listview with 20 items and listview is set to have checkboxes and allow multiselect.
If I click on the first listitem, and then hold shift and select the fifth listitem, it selects 1-5 as it should, but checks items 1-4 (or unchecks if they were already checked)
I am using 1.1 (2003)
I was able to use a work around
VB Code:
Private Sub lvwCustomers_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles lvwCustomers.ItemCheck
If _ShiftOrCtrlPressed Then
e.NewValue = e.CurrentValue
End If
End Sub
Private Sub lvwCustomers_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles lvwCustomers.KeyDown
If e.Shift Or e.Control Then
_ShiftOrCtrlPressed = True
End If
End Sub
Private Sub lvwCustomers_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles lvwCustomers.KeyUp
_ShiftOrCtrlPressed = False
End Sub
-
Jan 3rd, 2006, 03:24 PM
#6
Re: [RESOLVED] Listview with checkboxes and multiselect
i realize you have a work around i'm just trying like hell to duplicate this on my machine and i can't get it to do it
-
Jan 3rd, 2006, 03:27 PM
#7
Re: [RESOLVED] Listview with checkboxes and multiselect
lol... hmmm well I am not crazy.. it was happening 
I will comment out my work around code and confirm my steps to produce it.
-
Jan 3rd, 2006, 03:35 PM
#8
Re: [RESOLVED] Listview with checkboxes and multiselect
oh i believe you i just want to make sure that i'm doing the same thing you are to see if i can reproduce the same issue. is the first item checked???
-
Jan 3rd, 2006, 03:44 PM
#9
Re: [RESOLVED] Listview with checkboxes and multiselect
mystery solved. It behaves how I described only if .FullRowSelect is set to true (which it is in my case). It is set to false by default, and does not cause the checkboxes to be checked.
In any event, I need to use my workaround, because I need fullrowselect.
-
Jan 3rd, 2006, 03:56 PM
#10
Re: [RESOLVED] Listview with checkboxes and multiselect
ok that is by far the strangest thing i've seen. i finally got it to do it but it only happens when i have subitems and if i actually click on a subitem.
if i select whatever item i select and hold the shift key down and select some other item that's the first item i doesn't place the checks...
however if i select any item then hold the shift key down and click on an item that's a subitem then it does exactly what you were saying... just strange
-
Jan 3rd, 2006, 04:50 PM
#11
Re: [RESOLVED] Listview with checkboxes and multiselect
i am sure this is "by design" behavior, but I would think they would at least put an option to enable or disable it from happening.. oh well, at least im not scratching my head over it anymore
-
Mar 8th, 2020, 12:57 AM
#12
Hyperactive Member
Re: [RESOLVED] Listview with checkboxes and multiselect
 Originally Posted by kleinma
i am sure this is "by design" behavior, but I would think they would at least put an option to enable or disable it from happening.. oh well, at least im not scratching my head over it anymore 
dear sir, did you find a better alternative?
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
|