Somebody please help.
I have a listview with checkboxes option turned on. when I select multiple
items by clicking mouse button it is automatically turning on check boxes
for previous selected items. I do not want this behaviour (because when user
unselects a item the check box is not turned off).
how can I disable this behaviour, even if it means subclassing please let me
know if this is possible. I tried the following code.....
for i = 0 to listview1.items.count - 1
listview1.item(i).checked = listview1.item(i).selected
next
thank you!
Dim i As Integer
For i = 0 To ListView1.Items.Count - 1
ListView1.Items(i).Checked = ListView1.Items(i).Selected
Next
End Sub
Does this answer your question?
Dan Morseburg and Baiju (VB)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Srinivas Kotipalli" <srin...@sbcglobal.net> wrote in message
news:uZsxXBKJCHA.2320@tkmsftngp11...
1. I have a list view - with CheckBoxes and 'FullRowSelect' and also
'Multiselect' turned on.
2. Now when I multiselect the items, by holding down shift button and mouse
click, all the "****previous*****" items get selected. So far so good. But
if we unselect it or change the selection mode, by clicking the mouse
somewhere else, it does not get unchecked.
3. First of all, I do not know why the check box is getting checked when I
do multiselect. I tried the code as I explained in the previous post and lot
of other ways like 'ItemCheck' event etc., etc., to change this behaviour.
Please let me know if you need further details. Thanks for any help and
advice, I do not want to buy a third party tool for this. So far in this
application we are not using any third party control.
Only two things may force us go that route. The listview does not allow
Wrapper text in column headers, and this (mis)behaviour of Checkboxes. Any
help will be much appreciated.
Thank you!
"VBDotNet Team [MS]" <vbdo...@microsoft.com> wrote in message
news:uelJMzrJCHA.1636@tkmsftngp10...
By default if you single-click any item it becomes selected, but not
checked. If you shift+click items, they become multi-selected but not
checked. If you double-click a single item, it becomes selected and
checked, and all previously checked items remain checked. Let's say you
have items A, B, C, D, E, F in the ListView. If you add the code sample
below to the SelectedIndexChanged event, click A, then Shift+double-click D,
items A, B, C & D will be both selected and checked. To select and check
additional items use Ctrl+click.
If you have no code in your SelectedIndexChanged event then clicking and
shift+clicking will select, but not check the items. We're not sure which
behavior you want to change, the fact that the items become de-selected, or
unchecked, or both? What real-world situation are you trying to solve?
Dan Morseburg and Baiju (VB)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Srinivas Kotipalli" <srin...@sbcglobal.net> wrote in message
news:uuP2IwvJCHA.2320@tkmsftngp11...
Everything is like you explained in the first paragraph. And let us assume I
have five items in my listview viz., A,B,C,D,E and F. And I have no code in
the SelectedIndexChanged event.
1. If I shift+click item A. Item gets selected and not checked.
2. Now shift+Click item B. Item A gets checked.
3. Now just click on item B. Item A which got checked due to previous action
(step 2) does not get unchecked.
do you see the same behaviour or is it something to do with my settings or
am I doing something wrong.
The business behind the problem is:
Use has an option to select multiple items in the listview. As he selects
the items a running total of the selected items is calculated
(selectedindexchanged event is used). If he is satisfied with the total he
will then check all the selected items and do some process with the checked
items.
My problem is with step 2. If I shift+click multiple items, except for the
current item all other items get selected as well checked. Am I clear now?
Please let me know.
thank you!
"VBDotNet Team [MS]" <vbdo...@microsoft.com> wrote in message
news:eR5XhS4JCHA.1620@tkmsftngp10...
If the user just wants to check all items that have been selected, you could
add a button to the form which will check all selected items in the
ListView. Put the following code in the event handler for the button click:
Dim myItem As ListViewItem
' Uncheck all checked items
For Each myItem In ListView1.CheckedItems
myItem.Checked = False
Next
' Check currently selected items
For Each myItem In ListView1.SelectedItems
myItem.Checked = True
Next
Dan Morseburg & Baiju (VB)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Srinivas Kotipalli" <srin...@sbcglobal.net> wrote in message
news:OE#c$67JCHA.2404@tkmsftngp11...
Thanks for bringing this issue to our attention. We will report the behavior
to our development team.
Dan & Baiju (VB)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Srinivas Kotipalli" <srin...@sbcglobal.net> wrote in message
news:el8j5mHKCHA.1900@tkmsftngp11...
> Hi Dan & Baiju ,
>
> Okay, As suggested by you I created the new application and the behaviour
is
> same for me. I am also attaching the code. One thing I noticed is....
>
> 1. Check boxes are always attached to the first column in the list view.
> 2. If you multiselect items by shift+ click on the first column - the
items
> do not get checked.
> 3. But when I shift + click on any column other than first - the items get
> checked like I posted.
>
> When it is full row select - user may click anywhere on the item (I mean
on
> any column!). Hope you will agree with me now?
> thank you,
> Srinivas
>
> "VBDotNet Team [MS]" <vbdo...@microsoft.com> wrote in message
> news:Or5RdtEKCHA.1356@tkmsftngp10...
"VBDotNet Team [MS]" <vbdo...@microsoft.com> wrote in message
news:##WrAWRKCHA.2156@tkmsftngp10...