Multiple selection in Hierarchical Listbox Possible?

I need to have a hierarchical listbox support multiple selections, even if only at the same level of the hierarchy. But, setting the SelectionType to Multiple seems to have no effect; I am still able to select only a single row.

Am I missing something, or does the Xojo listbox not support multiple selection in a hierarchical instance? Is this documented somewhere?

I suppose I could switch to using the Einhugur TreeView control, but I’d rather not have to go through re-doing the work I’ve already done in my working listbox…

Multiple selections (me.SelectionType = Listbox.SelectionMultiple) works with hierarchical Listboxes (Xojo 2013R3).

Works for me, too, on OSX with Cocoa and Carbon, so maybe you have a special case that you’re not aware of yet.

Well, geez. I just tried to create a simple new project, and the hierarchical listbox I created DOES, indeed, allow multiple selections, but the one in my “real” project does NOT.

Interestingly, in trying to find any differences in either the project or the listbox configuration itself (I found none, BTW), I realized that the Inspector pane in the two projects has the sections listed in a different order for the two listboxes. In the test project (on which the listbox DOES work the way it should), the order is:
ID, Behavior, Control Set, Position, Locking, Focus Control, Appearance, Font, and Database Binding.

On the one in my real project (which does not work as desired), the order is:
ID, Appearance, Behavior, Control Set, Position, Locking, Focus Control, Font, and Database Binding.

Looking at the text version of both projects, the order of properties is identical, though I would not have guessed that would matter.

WTF could be going on ???

• Set me.SelectionType = Listbox.SelectionMultiple in the OpenEvent.
• Maybe your ListBox is a SubClass and SelectionType = Listbox.SelectionSingle is set by source

No; it is the standard listbox, no sub-classing, and no setting of the property in code anywhere.

So far, I’ve relied on the setting in the Inspector (and the xojo_window file does have the correct setting for the property), but I will try explicitly setting it in code to mutiple when I am back in the office tomorrow.

Thanks…

Still don’t get it. I tried explicitly setting the selection mode in the open event of the listbox, and I was still unable to make a multiple selection. When I paste the “working” listbox from my test project into the same window of my “real” project, right next to my original one, it works there , even with all the same event code as the original listbox placed in it, but the original one does not.

Very strange yet subtle corruption of the project, it seems…

This sounds a lot like bugs that others have been seeing with Inspector Properties, where the IDE gets confused and seems to misunderstand what Class the object is or cache old values of properties, for example : <https://xojo.com/issue/29756>

Odd
I cant reproduce that here
There are some issues to dealing with a multiselect hierarchical listbox (which is why the tab order editor doesn’t allow multi selection) but they’re more in how to deal with the items than “you cant set it up”

Deselect the TCPSocket & reselect it

[quote=36512:@Peter Truskier]Still don’t get it. I tried explicitly setting the selection mode in the open event of the listbox, and I was still unable to make a multiple selection. When I paste the “working” listbox from my test project into the same window of my “real” project, right next to my original one, it works there , even with all the same event code as the original listbox placed in it, but the original one does not.

Very strange yet subtle corruption of the project, it seems…[/quote]

Q.: Can you select multiple rows with Shift-Click?

No; neither shit- nor command/ctrl-click on this particular listbox. Another interesting thing is that the order of the sections in the Inspector seems to be project-related. Every time I add a listbox to this project, the property sections show up in a different order than they do in a newly-created project. And, yet, I can find no difference in the files (text/vcp or XML) for the two. Nor does Arbed show any differences that might explain it (to me, at least).

Clean up the Xojo Cachefolders and try again. No other idea :frowning:

Worth a shot, I guess. Thanks for the suggestion.