hi,
based on HMG_DaD_* Funcktion by EDK i wrote this Sample for GRID.
!Note : i have transfer C-Code to HB_FUNC.PRG
copy items from a loaded grid to another grid or virtual grid
Moderator: Rathinagiri
Re: copy items from a loaded grid to another grid or virtual grid
Jimmy, it was perfect for my application, this edk work is very useful, now I need to use this feature to select more items at the same time ie multi items copy with drag.
Edk and Jimmy, can you help me how to do
- AUGE_OHR
- Posts: 2093
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: copy items from a loaded grid to another grid or virtual grid
hi
use Demo Source and change CELLNAVIGATION to MULTISELECT
use Demo Source and change CELLNAVIGATION to MULTISELECT
Code: Select all
FUNCTION Grid_2_UpDate( cDragFName, cDragCName, nDragGridValue, cDropCName, cDropFName, nDropGridValue, lCopy, lAdd )
LOCAL aItem = GetProperty( cDragFName, cDragCName, "Value" )
LOCAL aDragItems, aClone, i := 1 , iMax := LEN(aItem)
aClone := ACLONE(aItem)
FOR i := 1 TO iMax
// get select Item
aDragItems := _GetItem( cDragCName, cDragFName, aItem[ i ] )
// ADD Item to Target
Domethod( cDropFName, cDropCName, "AddItem", aDragItems )
NEXT
aClone := ASORT(aClone,,,{|x, y| x > y })
iMax := LEN(aClone)
FOR i := 1 TO iMax
// delete Item in Source
Domethod( cDragFName, cDragCName, "DeleteItem", aClone[ i ] )
NEXT
RETURN nil
have fun
Jimmy
Jimmy
Re: copy items from a loaded grid to another grid or virtual grid
AUGE_OHR wrote: ↑Thu Nov 12, 2020 1:06 am hi
use Demo Source and change CELLNAVIGATION to MULTISELECT
Code: Select all
FUNCTION Grid_2_UpDate( cDragFName, cDragCName, nDragGridValue, cDropCName, cDropFName, nDropGridValue, lCopy, lAdd ) LOCAL aItem = GetProperty( cDragFName, cDragCName, "Value" ) LOCAL aDragItems, aClone, i := 1 , iMax := LEN(aItem) aClone := ACLONE(aItem) FOR i := 1 TO iMax // get select Item aDragItems := _GetItem( cDragCName, cDragFName, aItem[ i ] ) // ADD Item to Target Domethod( cDropFName, cDropCName, "AddItem", aDragItems ) NEXT aClone := ASORT(aClone,,,{|x, y| x > y }) iMax := LEN(aClone) FOR i := 1 TO iMax // delete Item in Source Domethod( cDragFName, cDragCName, "DeleteItem", aClone[ i ] ) NEXT RETURN nil
Jimmy was perfect, now let's move forward, I have to clone the grid in a form main for a form2 of the modal type, no longer in the same form this is possible with drag