Spread Windows Forms 7.0 Product Documentation
AddColumns Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > IRangeSupport Interface : AddColumns Method


column
Column index of column after which to add columns
columnCount
Number of columns to add

Glossary Item Box

Adds columns of cells after the specified column.

Syntax

Visual Basic (Declaration) 
Sub AddColumns( _
   ByVal column As Integer, _
   ByVal columnCount As Integer _
) 
Visual Basic (Usage)Copy Code
Dim instance As IRangeSupport
Dim column As Integer
Dim columnCount As Integer
 
instance.AddColumns(column, columnCount)
C# 
void AddColumns( 
   int column,
   int columnCount
)

Parameters

column
Column index of column after which to add columns
columnCount
Number of columns to add

Example

This example adds columns and rows to the active sheet with the range support interface.
C#Copy Code
FarPoint.Win.Spread.Model.IRangeSupport irs;
DialogResult dlg;
irs = (FarPoint.Win.Spread.Model.IRangeSupport)fpSpread1.ActiveSheet.Models.Data;
fpSpread1.ActiveSheet.ColumnCount = 2;
fpSpread1.ActiveSheet.RowCount = 2;
dlg = MessageBox.Show("Do you want to add some columns and rows?", "AddColumns", MessageBoxButtons.YesNo);
if (dlg == DialogResult.Yes)
{
irs.AddColumns(1, 3);
irs.AddRows(1, 3);
}
Visual BasicCopy Code
Dim irs As FarPoint.Win.Spread.Model.IRangeSupport
Dim dlg As DialogResult
irs = FpSpread1.ActiveSheet.Models.Data
FpSpread1.ActiveSheet.ColumnCount = 2
FpSpread1.ActiveSheet.RowCount = 2
dlg = MessageBox.Show("Do you want to add some columns and rows?", "AddColumns", MessageBoxButtons.YesNo)
If dlg = DialogResult.Yes Then
irs.AddColumns(1, 3)
irs.AddRows(1, 3)
End If

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

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