NO

Author Topic: Expanding ListView Groups programatically  (Read 408 times)

Offline John Z

  • Member
  • *
  • Posts: 358
Expanding ListView Groups programatically
« 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)

Offline Grincheux

  • Member
  • *
  • Posts: 329
  • Never be pleased, always improve
    • Arachne
Re: Expanding ListView Groups programatically
« Reply #1 on: July 10, 2021, 06:37:05 pm »
No idea, but a good idea.
-------------------------
Kenavo / Bye

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 579
    • Homepage
Re: Expanding ListView Groups programatically
« Reply #2 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.
---
Stefan

Proud member of the UltraDefrag Development Team


Offline John Z

  • Member
  • *
  • Posts: 358
Re: Expanding ListView Groups programatically
« Reply #4 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


Offline John Z

  • Member
  • *
  • Posts: 358
Re: Expanding ListView Groups programatically
« Reply #6 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