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


Glossary Item Box

Occurs when the user drags to fill a range of cells.

Syntax

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

Event Data

The event handler receives an argument of type DragFillBlockEventArgs containing data related to this event. The following DragFillBlockEventArgs properties provide information specific to this event.

PropertyDescription
Cancel Gets or sets whether to cancel the fill.
ColumnBegin Gets the column index of the top left cell of the range being used for the fill.
ColumnEnd Gets the column index of the bottom right cell of the range being used for the fill.
DataOnly Gets the data only flag.
Direction Gets the direction of the fill.
NumberToCopy Gets the number of rows or columns being filled.
RowBegin Gets the row index of the top left cell of the range being used for the fill.
RowEnd Gets the row index of the bottom right cell of the range being used for the fill.

Remarks

This event is raised by the OnDragFillBlock method when the user drags to fill a range of cells.

For more details on the individual event arguments, refer to DragFillBlockEventArgs 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, "Fill");
dlg = MessageBox.Show("If you want to Drag+Fill click the YES button and place the mouse pointer on the bottom-right edge
of the selection then drag and fill.This will fire the event.", "DragFill", MessageBoxButtons.YesNo);
if (dlg == DialogResult.Yes)
{
     fpSpread1.ActiveSheet.AddSelection(0, 0, 3, 1);
     fpSpread1.AllowDragFill = true;
}

private void fpSpread1_DragFillBlock(object sender, FarPoint.Win.Spread.DragFillBlockEventArgs e)
{
     ListBox1.Items.Add("DragFillBlock 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, "Fill")
dlg = MessageBox.Show("If you want to Drag+Fill click the YES button and place the mouse pointer on the bottom-right edge
of the selection then drag and fill.This will fire the event.", "DragFill", MessageBoxButtons.YesNo)
If dlg = DialogResult.Yes Then
     FpSpread1.ActiveSheet.AddSelection(0, 0, 3, 1)
     FpSpread1.AllowDragFill = True
End If

Private Sub FpSpread1_DragFillBlock(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.DragFillBlockEventArgs) Handles
FpSpread1.DragFillBlock
     ListBox1.Items.Add("DragFillBlock event fired!")
End Sub

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

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