Need a list that allows dragging to change the order

Started by EricStiles, June 19, 2012, 07:11:00 PM

Previous topic - Next topic

EricStiles

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

You can use a listbox control with "Drag/Drop Allow Begin" and "Drag/Drop Allow Drop" both set to true.

EricStiles


EricStiles

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 Short

This does work. What event would fire after dropping in new location so new list could be save immediately?
Jim Short

Fred Tomke

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
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Jim Short

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
Jim Short

Fred Tomke

Hi, Jim,
Quote from: Jim Short on July 12, 2016, 05:12:54 AM
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
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]