Spread for ASP.NET 7.0 Product Documentation
AddColumn(Int32) Method
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Model Namespace > DefaultSheetDataModel Class > AddColumn Method : AddColumn(Int32) Method


column
Index of column at which to add a new column

Glossary Item Box

Adds a column to the data model at the specified position.

Syntax

Visual Basic (Declaration) 
Public Overloads Sub AddColumn( _
   ByVal column As Integer _
) 
Visual Basic (Usage)Copy Code
Dim instance As DefaultSheetDataModel
Dim column As Integer
 
instance.AddColumn(column)
C# 
public void AddColumn( 
   int column
)

Parameters

column
Index of column at which to add a new column

Remarks

If you want to add more than one column, use the AddColumns method.

This method does not have an effect if the model is data bound.

Example

This example shows the use of this method by adding a new column to the model in the click event of a button and placing it in front of the fourth column.
C#Copy Code
 private void Button1_Click(object sender, System.EventArgs e)
{
  FarPoint.Web.Spread.Model.DefaultSheetDataModel dm = (FarPoint.Web.Spread.Model.DefaultSheetDataModel)FpSpread1.ActiveSheetView.DataModel;
  dm.AddColumn(2);
}
Visual BasicCopy Code
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.AddColumn(2)
End Sub

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

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