Pelles C forum

C language => Windows questions => Topic started by: John Z on July 10, 2021, 05:52:41 PM

Title: Expanding ListView Groups programatically
Post by: John Z on July 10, 2021, 05:52:41 PM
Looking for some help.  I'm trying to expand a ListView which has Groups without the user needing to click on the + for each group.  An example of what I'm trying to expand can be seen in Pelles Debug 'Globals'.  There are many groups there I'd like to expand all groups.  I've tried too many things to list here  :( without success.
WWW search was unsuccessful too at least for something under win32 which is what I need....

Hoping for some ideas.

John Z

1st attachment is grouped example, 2nd attachment is with the first group 'ungrouped' (by clicking, not programmatically)
Title: Re: Expanding ListView Groups programatically
Post by: Grincheux on July 10, 2021, 06:37:05 PM
No idea, but a good idea.
Title: Re: Expanding ListView Groups programatically
Post by: Stefan Pendl on July 10, 2021, 07:13:16 PM
Add two context menu options "expand all" and "collapse all", you would cycle through the nodes and expand or collapse the nodes.
You could also add "expand/collapse one level" or similar.
Sorry never did this in C with Win32 API.
May be search for "expand all listview" there should be some results.
Title: Re: Expanding ListView Groups programatically
Post by: Grincheux on July 10, 2021, 08:01:45 PM
https://stackoverflow.com/questions/6873345/expand-all-children-in-expandable-list-view (https://stackoverflow.com/questions/6873345/expand-all-children-in-expandable-list-view)
https://docs.microsoft.com/fr-fr/windows/win32/api/commctrl/ns-commctrl-lvgroup?redirectedfrom=MSDN (https://docs.microsoft.com/fr-fr/windows/win32/api/commctrl/ns-commctrl-lvgroup?redirectedfrom=MSDN)

https://social.msdn.microsoft.com/Forums/en-US/119921d4-bf2d-4f9b-a583-77442dee31b5/lvgscollapsible-option-ignored-in-normal-listview-control-but-only-in-release-build?forum=windowsuidevelopment
Title: Re: Expanding ListView Groups programatically
Post by: John Z on July 11, 2021, 12:40:46 AM
Thank you both I'll check the references listed by Sir Grincheux.

Add two context menu options "expand all" and "collapse all", you would cycle through the nodes and expand or collapse the nodes.
You could also add "expand/collapse one level" or similar.
Sorry never did this in C with Win32 API.
May be search for "expand all listview" there should be some results.
  Yes that was the plan but none of the code I tried would programmatically "expand All", or "each"

Thanks to you both.  We will see. I'll try until I succeed  :)

John Z
Title: Re: Expanding ListView Groups programatically
Post by: John Z on July 11, 2021, 12:43:50 AM
https://stackoverflow.com/questions/6873345/expand-all-children-in-expandable-list-view (https://stackoverflow.com/questions/6873345/expand-all-children-in-expandable-list-view)
https://docs.microsoft.com/fr-fr/windows/win32/api/commctrl/ns-commctrl-lvgroup?redirectedfrom=MSDN (https://docs.microsoft.com/fr-fr/windows/win32/api/commctrl/ns-commctrl-lvgroup?redirectedfrom=MSDN)

https://social.msdn.microsoft.com/Forums/en-US/119921d4-bf2d-4f9b-a583-77442dee31b5/lvgscollapsible-option-ignored-in-normal-listview-control-but-only-in-release-build?forum=windowsuidevelopment

I found these they didn't help the first is Android.
I tried LVGROUP (second one)
I'm looking closely at your last link.

Thanks

John Z
Title: Re: Expanding ListView Groups programatically
Post by: John Z on July 11, 2021, 02:02:26 AM
Found some articles that might help me see what I’m doing wrong.

Thanks everyone

John Z