
This article explains how to add drag-and-drop functionality to GraphWorX displays. The attached file contains the sample display used here.
Some objects in GraphWorX have parameters related to drag-and-drop, with the most common use cases being adding it to a datasource or command.
Adding drag-and-drop to a datasource
By setting the DragDropDataSource parameter of a process point to True, the process point becomes available for drag-and-drop, for example onto a Trend Viewer control.
If the display contains a Trend Viewer control, dragging the process point onto it will create a new pen with the selected tag:
Adding drag-and-drop to a command
Adding drag-and-drop to a command will execute that command on the target which it was dragged onto. This can be used to quickly drag displays onto different GraphWorX Viewer controls, for example.
To do this, each GraphWorX Viewer control in the display needs to have a unique name. To enable drag-and-drop, the DragDrop parameter of the Load Display command needs to be set to True:
In the example above, drag-and-drop would work in Runtime only for the window1 viewer control. If you want drag-and-drop to work on any GraphWorX Viewer in your display, change the TargetName parameter to *:
With this setting multiple displays can be dragged onto different GraphWorX Viewer controls, for example to compare data from different assets.