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


column
Column index at which to start move (first column)
count
Number of columns to move
toColumn
Destination before which to copy range of columns

Glossary Item Box

Moves the column or columns to a specified location.

Syntax

Visual Basic (Declaration) 
Public Sub MoveColumn( _
   ByVal column As Integer, _
   ByVal count As Integer, _
   ByVal toColumn As Integer _
) 
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim column As Integer
Dim count As Integer
Dim toColumn As Integer
 
instance.MoveColumn(column, count, toColumn)
C# 
public void MoveColumn( 
   int column,
   int count,
   int toColumn
)

Parameters

column
Column index at which to start move (first column)
count
Number of columns to move
toColumn
Destination before which to copy range of columns

Remarks

Use this method to move the data and formatting in a range of columns in the sheet. It cuts and moves all contents to the column in front of the specifed destination column.

Moving a range of columns with this method moves the data and formatting, including formulas and cell notes.

Moving a range of columns with this method cuts the columns and pastes them in front of the specified location. The pasted columns are inserted before the specified column. For example, moving columns B and C to column F cuts columns B and C and pastes them in front of column F.

Example

This example moves two columns.
C#Copy Code
FarPoint.Web.Spread.SheetView sv;
sv = FpSpread1.ActiveSheetView;
sv.SetValue(0, 0, 1);
sv.SetValue(0, 1, 2);
sv.SetValue(0, 2, 3);
sv.SetValue(0, 3, 4);

sv.MoveColumn(0, 1, 2);
Visual BasicCopy Code
Dim sv As FarPoint.Web.Spread.SheetView
sv = FpSpread1.ActiveSheetView
sv.SetValue(0, 0, "One")
sv.SetValue(0, 1, "Two")
sv.SetValue(0, 2, "Three")
sv.SetValue(0, 3, "Four")

sv.MoveColumn(0, 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.