Spread Windows Forms 6.0 Product Documentation
AddColumns Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class : AddColumns Method


column
Position at which to add the new column(s)
count
Number of columns to add

Glossary Item Box

Adds the column or columns to the data model at the specified index.

Syntax

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

Parameters

column
Position at which to add the new column(s)
count
Number of columns to add

Example

This example adds two columns to the active sheet.
C#Copy Code
DialogResult dlg;
fpSpread1.ActiveSheet.Columns.Count = 4;
dlg = MessageBox.Show("Do you want to add some columns?", "AddColumns", MessageBoxButtons.YesNo);
if (dlg == DialogResult.Yes)
{
    fpSpread1.ActiveSheet.AddColumns(0, 2);
}
Visual BasicCopy Code
Dim dlg As DialogResult
FpSpread1.ActiveSheet.Columns.Count = 4
dlg = MessageBox.Show("Do you want to add some columns?", "AddColumns", MessageBoxButtons.YesNo)
If dlg = DialogResult.Yes Then
    FpSpread1.ActiveSheet.AddColumns(0, 2)
End If

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

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