[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
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
Re: Listview with checkboxes and multiselect
what version are you running?
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
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
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
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.
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???
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.
Re: [RESOLVED] Listview with checkboxes and multiselect
:ehh: 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 :sick:
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 :)
Re: [RESOLVED] Listview with checkboxes and multiselect
Quote:
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?