Spread ASP.NET 6.0 Product Documentation
Move Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > DefaultSheetDataModel Class : Move Method


fromRow
Row index of starting position of range to move
fromColumn
Column index of starting position of range to move
toRow
Row index of starting position of destination
toColumn
Column index of starting position of destination
rowCount
Number of rows in range
columnCount
Number of columns in range

Glossary Item Box

Moves the data from a range of cells to the specified location.

Syntax

Visual Basic (Declaration) 
Public Sub Move( _
   ByVal fromRow As Integer, _
   ByVal fromColumn As Integer, _
   ByVal toRow As Integer, _
   ByVal toColumn As Integer, _
   ByVal rowCount As Integer, _
   ByVal columnCount As Integer _
) 
Visual Basic (Usage)Copy Code
Dim instance As DefaultSheetDataModel
Dim fromRow As Integer
Dim fromColumn As Integer
Dim toRow As Integer
Dim toColumn As Integer
Dim rowCount As Integer
Dim columnCount As Integer
 
instance.Move(fromRow, fromColumn, toRow, toColumn, rowCount, columnCount)
C# 
public void Move( 
   int fromRow,
   int fromColumn,
   int toRow,
   int toColumn,
   int rowCount,
   int columnCount
)

Parameters

fromRow
Row index of starting position of range to move
fromColumn
Column index of starting position of range to move
toRow
Row index of starting position of destination
toColumn
Column index of starting position of destination
rowCount
Number of rows in range
columnCount
Number of columns in range

Exceptions

ExceptionDescription
System.ArgumentException Specified starting and ending row or row count is not valid
System.ArgumentException Specified starting and ending column or column count is not valid

Remarks

This method moves the data of the range of cells.

The destination column and row indicate the upper left cell of the destination block. The contents of the destination block cells are replaced by the moved cells' contents.

Caution: Moving a range of cells pastes them over existing cells. You might want to caution users and have them verify a move command before overwriting their existing data.

Example

This example adds data to two cells and then in the click event of a button moves the data to different cells.
Visual BasicCopy Code
PrivateSubPage_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load

If(Me.IsPostBack)ThenReturn

FpSpread1.ActiveSheetView.DataModel.SetValue(0,0,"FarPoint")
FpSpread1.ActiveSheetView.DataModel.SetValue(0,1,"Technologies")

EndSub

PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesButton1.Click
DimdmAsFarPoint.Web.Spread.Model.DefaultSheetDataModel=CType(FpSpread1.ActiveSheetView.DataModel,FarPoint.Web.Spread.Model.DefaultSheetDataModel)
dm.Move(0,0,2,2,1,2)
EndSub
C#Copy Code
privatevoidPage_Load(objectsender,System.EventArgse)
{
if(this.IsPostBack)return;

FpSpread1.ActiveSheetView.DataModel.SetValue(0,0,"FarPoint");
FpSpread1.ActiveSheetView.DataModel.SetValue(0,1,"Technologies");
}

privatevoidButton1_Click(objectsender,System.EventArgse)
{
FarPoint.Web.Spread.Model.DefaultSheetDataModeldm=(FarPoint.Web.Spread.Model.DefaultSheetDataModel)FpSpread1.ActiveSheetView.DataModel;
dm.Move(0,0,2,2,1,2);
}

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.