Page 1 of 1

Drag Data from one datagrid to another

Posted: Tue Aug 30, 2016 6:44 pm
by lohill
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

Re: Drag Data from one datagrid to another

Posted: Tue Aug 30, 2016 6:52 pm
by Klaus
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

Re: Drag Data from one datagrid to another

Posted: Tue Aug 30, 2016 7:05 pm
by lohill
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

Re: Drag Data from one datagrid to another

Posted: Tue Aug 30, 2016 7:38 pm
by Klaus
Ah, sorry, looks like I misunderstood your problem.
Sorry, no brilliant idea in the moment...