Link Search Menu Expand Document

SSpread.DragDropBlock Event

Occurs when a cell block is dragged and dropped to another location.

The following child objects are attached to the Event object.

Type Name Description
Number Col The leftmost column number of the cell block from which you dragged
Number Row The row number at the top of the cell block from which you dragged
Number Col2 Rightmost column number of the cell block from which you dragged
Number Row2 Row number at the bottom of the cell block from which you drag
Number NewCol The leftmost column number of the cell block to drop to
Number NewRow The row number at the top of the cell block to drop to
Number NewCol2 Rightmost column number of the cell block to drop to
Number NewRow2 The row number at the bottom of the cell block to drop to
Number Overwrite 0 if the cell block to drop to has no value, non-zero if there is a value
Number Action Specify move / copy 1 (copy) if dragged and dropped while holding down the [ Ctrl ] key, 0 (move) otherwise

To use cell block drag and drop, set the AllowDragDrop property to $TRUE.

Example of usage

Function OnDragDropBlock(e) {
    var srcBlock = strf("%1 to %2 , %3 to %4 ", e.Col , e.Col2 , e.Row, e.Row2);
    var dstBlock = strf("%1 column to %2 column , %3 row to %4 row ", e.NewCol, e.NewCol2, e.NewRow, e.NewRow2);
    
    var actionText;
    if (e.Overwrite == $FALSE) {
        if (e.Action == 1) {
            actionText = " copy ";
        } else {
            actionText = " move ";
        }
    } else {
        if (e.Action == 1) {
            actionText = " Overwrite copy ";
        } else {
            actionText = " Overwrite move ";
        }
    }
    MessageBox (strf (" % 3 from [% 1] to [% 2] " , srcBlock, dstBlock, actionText));
}

Related Item
AllowDragDrop property