Drag Data from one datagrid to another

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
lohill
Posts: 770
Joined: Tue Dec 08, 2009 6:37 pm

Drag Data from one datagrid to another

Post by lohill » Tue Aug 30, 2016 6:44 pm

The attached LiveCode test of drag-drop from one datagrid to another is pretty much what I want. I can drag single or multiple lines from the 'source' datagrid and drop them on the 'destination' datagrid. The one further behavior I would like to have is to be able to drag multiple lines in the 'source' grid and have them be selected (highlighted) so that they can then be moved to the 'destination' grid. The only way I can select multiple lines for dragging is with click followed by shift-click. Is there any way this can be fixed?

(The button at the top of the screen can be used to restore the two grids to their original contents.)

As a side note, I have noticed that putting break points in the 'drag' events of either of the grids can cause the debugger to get locked up to where you cannot edit the code. The only solution I could find was to close the script editor and re-open it.

Larry
Attachments
DragTest.livecode.zip
(6.18 KiB) Downloaded 271 times

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Drag Data from one datagrid to another

Post by Klaus » Tue Aug 30, 2016 6:52 pm

Hi Larry,
lohill wrote:... The only way I can select multiple lines for dragging is with click followed by shift-click...
just like in other applications you can use CMD-Click to select non-contiguous lines in a datagrid! Is that what you mean?
Tested and works out-of-the-box also with your example stack :D


Best

Klaus

lohill
Posts: 770
Joined: Tue Dec 08, 2009 6:37 pm

Re: Drag Data from one datagrid to another

Post by lohill » Tue Aug 30, 2016 7:05 pm

Hi Klaus,

I do know about cmd-click and that it does work with my test program. What I am not able to do is to select a contiguous set of lines with a 'drag'. I have to click the first and shift-click the last. In regular (ie. no drag-drop) datagrids that allow multiple lines to be selected you can just drag through contiguous lines to select them. (Additional non-contiguous line can be added with cmd-click.)

Larry

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Drag Data from one datagrid to another

Post by Klaus » Tue Aug 30, 2016 7:38 pm

Ah, sorry, looks like I misunderstood your problem.
Sorry, no brilliant idea in the moment...

Post Reply