When you create a sheet, it is automatically created with five hundred columns and five hundred rows. You can change the number from zero up to two billion column and rows.
For more details, refer to the SheetView.RowCount property and SheetView.ColumnCount property.
You can also restrict the user from accessing various rows and columns. For more information, refer to Allowing User Interaction with Rows and Columns.
Using the Properties Window
- At design time, in the Properties window, select the Spread component.
- Select the Sheets property.
- Click the button to display the SheetView Collection Editor.
- In the Members list, select the sheet for which to set the number of columns or rows.
- In the properties list, set the ColumnCount property to set the number of columns and the RowCount property to set the number of rows.
- Click OK to close the editor.
Using a Shortcut
Set the ColumnCount or RowCount property for the Sheets shortcut object.
Example
This example code sets the first sheet to have 10 columns and 100 rows.
C# | Copy Code |
---|---|
fpSpread1.Sheets[0].ColumnCount = 10; fpSpread1.Sheets[0].RowCount = 100; |
VB | Copy Code |
---|---|
FpSpread1.Sheets(0).ColumnCount = 10 FpSpread1.Sheets(0).RowCount = 100 |
Using Code
Set the ColumnCount or RowCount property for a SheetView object.
Example
This example code sets the first sheet to have 10 columns and 100 rows.
C# | Copy Code |
---|---|
FarPoint.Win.Spread.SheetView Sheet0; Sheet0 = fpSpread1.Sheets[0]; Sheet0.ColumnCount = 10; Sheet0.RowCount = 100; |
VB | Copy Code |
---|---|
Dim Sheet0 As FarPoint.Win.Spread.SheetView Sheet0 = FpSpread1.Sheets(0) Sheet0.ColumnCount = 10 Sheet0.RowCount = 100 |
Using the Spread Designer
- Select the sheet tab for the sheet for which you want to set the number of columns or rows.
- From the property list for the sheet, in the Appearance category, select Columns or Rows to expand the properties for the columns or rows in the sheet.
- In the list of properties for the columns or rows, set the Count property.
- From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer.