Spread Windows Forms 6.0 Product Documentation
DragDropBlock Event
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > FpSpread Class : DragDropBlock Event


Glossary Item Box

Occurs when the user drags and drops a range of cells.

Syntax

Visual Basic (Declaration) 
Public Event DragDropBlock As DragDropBlockEventHandler
Visual Basic (Usage)Copy Code
Dim instance As FpSpread
Dim handler As DragDropBlockEventHandler
 
AddHandler instance.DragDropBlock, handler
C# 
public event DragDropBlockEventHandler DragDropBlock

Event Data

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.

PropertyDescription
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).

Remarks

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.

Example

This example raises the event.
C#Copy Code
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!");
}
Visual BasicCopy Code
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

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.