Started by EricStiles ·
2012-06-20 02:11 UTC ·
7 replies · SMF topic #1818
EricStiles
2012-06-20 02:11 UTC
What would be the tool, if any, that would put a list on the screen and then allow you to drag items in the list to change the order items in the list?
owenwengerd
2012-06-20 05:40 UTC
You can use a listbox control with "Drag/Drop Allow Begin" and "Drag/Drop Allow Drop" both set to true.
EricStiles
2012-06-20 19:02 UTC
Thank you, I'll investigate that.
EricStiles
2012-06-20 19:11 UTC
Ok I'm working and shouldn't be doing this since I don't get paid to program but I had to see if that was what I was looking for, and IT IS!!! Thank you, OWENWENGERD!
Jim
2016-07-12 01:17 UTC
This does work. What event would fire after dropping in new location so new list could be save immediately?
fred_tomke
2016-07-12 04:32 UTC
Hi, Jim, I always set up my controls this way:
source control:
enable OnDragnDropBegin to ensure the user is allowed to drag the selected items
destination control:
enable OnDragOverFromControl to ensure the user is allowed to drop the selected items to the target
enable OnDragnDropFromControl to execute code to store the state into the databases
Regards, Fred
Jim
2016-07-12 12:12 UTC
Thanks Fred,
Does this work when dragging only within the same control like just changing order of the items?
Run built-in code DragDropBegin
Save with KillFocus.
Selecting additional events messes with built-in behavior.
Jim
fred_tomke
2016-07-12 14:03 UTC
Hi, Jim,
author=Jim Short link=topic=1818.msg11952#msg11952 date=1468325574 wrote:
Does this work when dragging only within the same control like just changing order of the items?
yes, it does. Just check in the code of OnDragOverFromControl and/or OnDragnDropFromControl that the source control name is the same as the destination control name.
Regards, Fred