PxPlus User Forum

Main Board => Discussions => Programming => Topic started by: Cedric on August 28, 2020, 04:59:17 AM

Title: Dragging cells within table
Post by: Cedric on August 28, 2020, 04:59:17 AM
Hi,

I'm trying to make my appointment module a bit more user friendly and was trying to use the drag and drop feature within the same table.  Is that even doable in Pxplus?  I think not since cells do not have IDs?   
Title: Re: Dragging cells within table
Post by: Susan Cryderman on August 28, 2020, 08:25:02 AM
Hello Cedric,

Yes - you can setup drag and drop from a grid control (GRID_1.CTL) to the same grid control.  If you then enter some PERFORM logic, this logic can do something like;

  r1=GRID_1.CTL'draggedrow,c1=GRID_1.CTL'draggedColno
  r2=GRID_1.CTL'droppedOnRow,c2=GRID_1.CTL'droppedOnColno

Once you have these drag and drop rows and columns - you can then use them to retrieve the current values (GRID_1.CTL'value$) and other properties of the cells as needed.
 
Title: Re: Dragging cells within table
Post by: Susan Cryderman on August 31, 2020, 10:06:37 AM
Cedric,

One think I forgot to mention ...

You also need to disable the 'MultiSelect property on your grid control in order for the system to know the difference between selecting multiple cells and dragging a cell.