Support Forums

Multiple select listview with checkbox's

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.
User avatar
Rodent
Posts: 40
Joined: Mon Apr 06, 2015 8:10 pm

Multiple select listview with checkbox's

Postby Rodent » Wed Feb 10, 2016 8:19 pm

Hi,

I'm creating a list of information in a listview control that has checkboxes set to true and muliselect set to true.

when I highlight say 3 items the control is only checking two items as seen in the attachment.

Is this something that you can fix, is it by design or is it a Microsoft problem....


Regards
Rodney
Attachments
Form.png
Form.png (25.07 KiB) Viewed 1921 times
User avatar
jvierra
Posts: 10043
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Multiple select listview with checkbox's

Postby jvierra » Thu Feb 11, 2016 2:21 am

Check and select are not the same thing. You need a full click to check.
User avatar
jvierra
Posts: 10043
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Multiple select listview with checkbox's

Postby jvierra » Thu Feb 11, 2016 2:26 am

Select all items by shift select or click select and click any checkbox and all will be checked. Thisis pretty much the default behavior of all forms that use a checked listview.
User avatar
Rodent
Posts: 40
Joined: Mon Apr 06, 2015 8:10 pm

Re: Multiple select listview with checkbox's

Postby Rodent » Sun Feb 14, 2016 6:53 pm

jvierra wrote:Check and select are not the same thing. You need a full click to check.


When I select multiple items they are being checked automatically, so when I select the first item and then shift select the third item the first two are being checked automatically (as attachment shows), I then have to check the third item manually by clicking on the checkbox of the third item (I should not have to do this), subsequence clicking of checkbox will check or uncheck all highlighted items.

When I write the same code in VS.net selecting multiple items does not check the checkboxes but clicking on one of the selected checkboxes they are all checked or unchecked. This is the proper behavior of a listview object.

regards
Rodney
User avatar
Rodent
Posts: 40
Joined: Mon Apr 06, 2015 8:10 pm

Re: Multiple select listview with checkbox's

Postby Rodent » Sun Feb 14, 2016 7:00 pm

The same goes with control clicking, I select the first item I would like to check then hold control down and select the second item I would like to check but only the first item is checked.
All subsequence selecting is the same the previously selected item is checked and not the item currently being selected so once I have finished highlighting all the items I want I still have to check the last item by clicking on its checkbox.

This is not the correct behavior.

Regards
Rodney
User avatar
jvierra
Posts: 10043
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Multiple select listview with checkbox's

Postby jvierra » Sun Feb 14, 2016 7:29 pm

VS - PowerShell. Doesn't matter. Windows handles the behavior. It is the same control everywhere.

By default selecting a row in a listview does NOT check the box. You need to click on the checkbox to check it.
User avatar
Rodent
Posts: 40
Joined: Mon Apr 06, 2015 8:10 pm

Re: Multiple select listview with checkbox's

Postby Rodent » Sun Feb 14, 2016 8:58 pm

jvierra wrote:VS - PowerShell. Doesn't matter. Windows handles the behavior. It is the same control everywhere.

By default selecting a row in a listview does NOT check the box. You need to click on the checkbox to check it.


That is not the behavior that I am experiencing! When I select more then one item the checkbox is being automatically checked.
User avatar
jvierra
Posts: 10043
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: Multiple select listview with checkbox's

Postby jvierra » Sun Feb 14, 2016 9:05 pm

Not for me. What have you changed in options and what code is altering the checkbox.

Download the sample and run it . It behaves correctly.
User avatar
Rodent
Posts: 40
Joined: Mon Apr 06, 2015 8:10 pm

Re: Multiple select listview with checkbox's

Postby Rodent » Sun Feb 14, 2016 9:19 pm

jvierra wrote:Not for me. What have you changed in options and what code is altering the checkbox.

Download the sample and run it . It behaves correctly.


OK I have found that you need multiple columns and FullRowSelect = true

Regards
Rodney
User avatar
Rodent
Posts: 40
Joined: Mon Apr 06, 2015 8:10 pm

Re: Multiple select listview with checkbox's

Postby Rodent » Sun Feb 14, 2016 9:20 pm

And yes I have found that VS works the same.

So I'll go with this is a Microsoft bug.

Return to “PowerShell GUIs”

Who is online

Users browsing this forum: No registered users and 5 guests