Copies the data from a range of cells to a specified range of cells.
Syntax
Parameters
- fromRow
- Row index of start of range from which to copy
- fromColumn
- Column index of start of range from which to copy
- toRow
- Row index of start of range to which to copy
- toColumn
- Column index of start of range to which to copy
- rowCount
- Number of rows to copy
- columnCount
- Number of columns to copy
Exceptions
Remarks
Example
This example adds data to the first three columns. In the click event of a button the data is copied from the first two columns and placed in cells in columns two and three.
Visual Basic | Copy Code |
---|
Private Sub Page_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles MyBase.Load
If(Me.IsPostBack)Then Return
FpSpread1.ActiveSheetView.RowCount=10
Dim i As Integer
For i=0 To 3
FpSpread1.ActiveSheetView.SetValue(i,0,i)
FpSpread1.ActiveSheetView.SetValue(i,1,i)
FpSpread1.ActiveSheetView.SetValue(i,2,i)
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles Button1.Click
Dim dm As FarPoint.Web.Spread.Model.DefaultSheetDataModel=CType(FpSpread1.ActiveSheetView.DataModel,FarPoint.Web.Spread.Model.DefaultSheetDataModel)
dm.Copy(0,0,5,1,3,2)
End Sub |
C# | Copy Code |
---|
private void Page_Load(object sender,System.EventArgs e)
{
if(this.IsPostBack)return;
FpSpread1.ActiveSheetView.RowCount=10;
for(int i=0;i<4;i++)
{
FpSpread1.ActiveSheetView.SetValue(i,0,i);
FpSpread1.ActiveSheetView.SetValue(i,1,i);
FpSpread1.ActiveSheetView.SetValue(i,2,i);
}
}
private void Button1_Click(object sender,System.EventArgs e)
{
FarPoint.Web.Spread.Model.DefaultSheetDataModel dm=(FarPoint.Web.Spread.Model.DefaultSheetDataModel)FpSpread1.ActiveSheetView.DataModel;
dm.Copy(0,0,5,1,3,2);
} |
Requirements
Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6
See Also