Some users have been asking for a long time for group headers to be displayed in a Listbox, as known from UITableView under macOS/iOS, for example.
Properties of a group header
When scrolling, the Listbox Header always takes the title of the group header, if enabled. This means we have to link the rows of a group to this group. When scrolling, how can I read out the current top row visible in the Listbox? Based on this row, I can then assign the group name to the Listbox header. If no group is assigned to a row, then the standard header caption should appear.
It should only be possible to rearrange the rows within the group. How could this be implemented? This should also be considered when sorting (click on the Listbox header). It should not be possible to move group headers at all.Ideas?
Rows have an optional alternating background color. This can be easily implemented using the CellBackgroundPaint-Event. But wait: The first row below the group header always starts with the alternating background color. This means that the simple query in CellBackgroundPaint-Event
I would love to do that, but I don’t have a Pro license that stores the project in the format required by Git. Feel free to upload the project to your Github account. Then others can make changes as well. Or just here in this thread via download links.
Exactly when you look at the Project, you will notice that the ListboxGroupEntry class contains a reference to the group it is in.
The data is only test data. It should not matter how many columns a list box has.
No, Karen, for the time being, this is only about the above-mentioned points.
My point was not to be able to do all of that (or push my listbox), but that you could do what you want using a hierarchical listbox for each group . The only real issue is to merge the header row (which if you are only doing that is not hard, AND you will have a disclose widget - which you don’t want.
Basically I’m saying is that I think implementing that grouping functionality using a hierarchical Xojo list box should not be that hard… and if there is a way to hide the disclosure widget, it would get you very close to what you want.