You can add one or more columns or rows to a sheet, and specify where the column or row is added. You can use the AddRows method and AddColumns method of the SheetView class to add row and column respectively.
If you set the cell type for the column and a row is inserted, the new cells in the column use the cell type for the entire column. If you set the cell type for individual cells and a new row is inserted, then the new cells use the default cell type, and you would need to set the cell type for each of the new cells.
For more details refer to the SheetView.AddRows method or SheetView.AddColumns method.
This example code adds two columns before 7th column.
C# |
Copy Code
|
---|---|
fpSpread1.Sheets[0].AddColumns(6,2); |
Visual Basic |
Copy Code
|
---|---|
fpSpread1.Sheets(0).AddColumns(6,2) |
This example code adds two columns before 7th column.
C# |
Copy Code
|
---|---|
FarPoint.Win.Spread.SheetView Sheet0; Sheet0 = fpSpread1.Sheets[0]; Sheet0.AddColumns(6,2); |
Visual Basic |
Copy Code
|
---|---|
Dim Sheet0 As FarPoint.Win.Spread.SheetView Sheet0 = fpSpread1.Sheets(0) Sheet0.AddColumns(6, 2) |
An additional row or column is added to the sheet.