I am giving Xojo a go after many years of being out of this kind of stuff. I started working on a simple form a short while ago, but I am shocked that I can’t see a way to do this. It seems like such a simple and absolutely needed thing. I must surely be missing something super simple because I can’t imagine this not being possible. I have this dropdown list: atrt
How do I re-arrange the items? Surely you don’t have to start over every time you need to add a new item and need them to be in a certain order? For example, if I had 15 items in the list (alphabetical order), and needed to add one, must I deleted them all, add the new one, and then add them all back?!
Indeed. It does not work. When I click to “initiate” the drag and drop process, it goes into edit of the name of the item. I am using Windows if that matters.
asking here as there is some context …
is there somewhere a working open source example of hierarchical listbox, with row reordering ?
I did not succeed in making one…
(but I did with a non-hierarchical one…)
thanks.
Yes, it feels little tricky, if you click one that is already selected it goes to edit, you need to click something that is not selected and start the drag:
With some difficulty, I made it work, but I wouldn’t like to have to understand again how I did it. Most of the code is in the DragReorderRows event. I also have an SQLite database whose contents reflect the organisation of the listbox. This is kept in sync as rows are moved around or dropped on a folder.
I solved this by adding a second small column, with only a small icon in it meaning “I can be dragged”, and that is a non editable cell. this way, you always start a drag if you clic on the icon.
Do you know if there is a feature request to add a small column with just an icon like:
so is easy to reorder the elements in a Xojo popupmenu or other control?
Edit: I see you added a GIF with what you did. Very good.
Also, instead of using the Pencil on the control, you can add the options using the Inspector - Initial Value and just paste the text in the order you want: