Drag grid item to another grid
Moderator: Rathinagiri
-
- Posts: 666
- Joined: Tue Jun 04, 2013 6:33 pm
- Location: Argentina
- Has thanked: 1 time
- Been thanked: 62 times
Re: Drag grid item to another grid
Hey Edward. What a great job. Excelente and usefull implementación. Congratulaciones.
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Has thanked: 411 times
- Been thanked: 120 times
- Contact:
We have many contribution code like this;edk wrote: ↑Fri Jan 11, 2019 1:50 pmAs promised here is the next version.
Added:
- support for Ctrl and Shift while dragging and dropping.
With the Shift key, you can move items by changing the position in the tree, with the Ctrl key we perform a copy operation.
- handling the context menu when dropping the right mouse button on tree # 2 (Copy / Move)
- handling the context menu of tree # 2 (on the tree item/node: Rename / Delete / Add as child ; in the empty tree space: Add New As Root )
- there is a new method for the tree: InsertItem
As I did not integrate this method with HMG sources, we call it as a function: _InsertItem (ControlName, FormName, cValue, nInsertPos, [aImage], [Id]).
Now you can build a tree using the context menu.![]()
Tree.gif
DragAndDrop_0.006.zip
Enjoy.
thanks to these successful participants.
Sadly adding this useful codes to the core of HMG not likely in the near future

there isn't a way adding them to next releases of HMG under a new section namely such "contributions"

Viva HMG, builder, developers, contributors, participants and followers

Viva INTERNATIONAL HMG 

- serge_girard
- Posts: 2657
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Has thanked: 939 times
- Been thanked: 173 times
- Contact:
-
- Posts: 631
- Joined: Thu Oct 16, 2014 11:35 am
- Location: Poland
- Has thanked: 150 times
- Been thanked: 556 times
Sample for a tree that uses IDs.
Unfortunately, in this variant there are constraints based on the necessity of assigning new IDs when copying/adding tree elements. Also, you would need to give ID for elements dragged from other controls like textbox or from other trees, which is why these functionalities have been removed. (DragAndDrop.prg is untouched)
Unfortunately, in this variant there are constraints based on the necessity of assigning new IDs when copying/adding tree elements. Also, you would need to give ID for elements dragged from other controls like textbox or from other trees, which is why these functionalities have been removed. (DragAndDrop.prg is untouched)