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


Glossary Item Box

Adds a column to the data model after the last column.

Syntax

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

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 adds a new column to the model in the click event of a button.
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();        
 }
Visual BasicCopy Code
 Private Sub Button1_Click(ByVal sender As 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()
 End Sub

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.