FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > FpSpread Class : DragDropBlock Event |
'Declaration Public Event DragDropBlock As DragDropBlockEventHandler
'Usage Dim instance As FpSpread Dim handler As DragDropBlockEventHandler AddHandler instance.DragDropBlock, handler
public event DragDropBlockEventHandler DragDropBlock
The event handler receives an argument of type DragDropBlockEventArgs containing data related to this event. The following DragDropBlockEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Action | Gets or sets whether the source range is copied or moved. |
Cancel | Gets or sets whether the copying or moving of data is cancelled. |
ColumnBegin | Gets the column index of the top left cell of the source range (being dragged). |
ColumnEnd | Gets the column index of the bottom right cell of the source range (being dragged). |
DataOnly | Gets or sets whether data or formatting (or both) is copied or moved. |
DestinationColumnBegin | Gets the column index of the top left cell of the destination range (where selection is dropped). |
DestinationColumnEnd | Gets the column index of the bottom right cell of the destination range (where selection is dropped). |
DestinationRowBegin | Gets the row index of the top left cell of the destination range (where selection is dropped). |
DestinationRowEnd | Gets the row index of the bottom right cell of the destination range (where selection is dropped). |
Overwrite | Gets whether the destination range contains data (that is overwritten). |
RowBegin | Gets the row index of the top left cell of the source range (being dragged). |
RowEnd | Gets the row index of the bottom right cell of the source range (being dragged). |
This event is raised by the OnDragDropBlock method when the user drags and drops a range of cells.
For more details on the individual event arguments, refer to DragDropBlockEventArgs members.
DialogResult dlg; fpSpread1.ActiveSheet.SetValue(0, 0, "Drag"); fpSpread1.ActiveSheet.SetValue(1, 0, "And"); fpSpread1.ActiveSheet.SetValue(2, 0, "Drop"); dlg = MessageBox.Show("If you want to Drag+Drop click the YES button and place the mouse pointer on the edge of the selection then drag and drop.This will fire the event.", "DragDrop", MessageBoxButtons.YesNo); if (dlg == DialogResult.Yes) { fpSpread1.ActiveSheet.AddSelection(0, 0, 3, 1); fpSpread1.AllowDragDrop = true; } private void fpSpread1_DragDropBlock(object sender, FarPoint.Win.Spread.DragDropBlockEventArgs e) { ListBox1.Items.Add("DragDropBlock event fired!"); }
Dim dlg As DialogResult FpSpread1.ActiveSheet.SetValue(0, 0, "Drag") FpSpread1.ActiveSheet.SetValue(1, 0, "And") FpSpread1.ActiveSheet.SetValue(2, 0, "Drop") dlg = MessageBox.Show("If you want to Drag+Drop click the YES button and place the mouse pointer on the edge of the selection then drag and drop.This will fire the event.", "DragDrop", MessageBoxButtons.YesNo) If dlg = DialogResult.Yes Then FpSpread1.ActiveSheet.AddSelection(0, 0, 3, 1) FpSpread1.AllowDragDrop = True End If Private Sub FpSpread1_DragDropBlock(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.DragDropBlockEventArgs) Handles FpSpread1.DragDropBlock ListBox1.Items.Add("DragDropBlock event fired!") End Sub
Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10