Spread Windows Forms 9.0 Product Documentation > Developer's Guide > Customizing Interaction in Cells > Using Drag Operations to Fill Cells > Filling Cells with Drag and Fill |
You can also allow the end user to drag-and-fill data from one cell or a range of cells to another cell or range of cells. With a cell or range of cells selected, you can fill other cells either in a row (or rows if more than one column is selected) or a column (or columns if more than one row is selected).
You can also specify whether the fill is a copy or a series. The copy option copies the data to the selected range. The series option increments or decrements the values based on the series. Drag down or to the right to increment the values. Drag up or to the left to decrement the values. Use the RangeDragFillMode property to specify the type of fill.
Spread uses the data model to determine whether the data can be incremented when using the series fill. The displayed values have a higher priority with the built-in cell types when using the series fill.
The example shown here uses the copy option to fill several cells in a column from the originally selected cell.
This example uses the series fill option.
You can customize the direction of the fill using the FillDirection enumeration.
For more information, refer to the AllowDragFill property in the FpSpread class. For more information on event arguments, refer to DragFillBlock event, DragFillBlockEventArgs, and DragFillBlockCompletedEventArgs.
Allow the drag-and-fill feature by setting the AllowDragFill property in the FpSpread component.
This example code sets the component to allow the drag-fill feature.
C# |
Copy Code
|
---|---|
fpSpread1.AllowDragFill = true;
|
VB |
Copy Code
|
---|---|
FpSpread1.AllowDragFill = True
|
Allow the drag-and-drop feature by setting the AllowDragFill property in the FpSpread component.
This example code sets the child sheet to allow the drag-fill feature.
C# |
Copy Code
|
---|---|
FarPoint.Win.Spread.SpreadView sv = fpSpread1.GetRootWorkbook();
sv.AllowDragFill = true;
|
VB |
Copy Code
|
---|---|
Dim sv As FarPoint.Win.Spread.SpreadView = FpSpread1.GetRootWorkbook sv.AllowDragFill = True |
or