Spread Windows Forms 17
Spread Windows Forms 17.0 Product Documentation / Developer's Guide / Rows and Columns / Customizing the Number of Rows or Columns
In This Topic
    Customizing the Number of Rows or Columns
    In This Topic

    When you create a sheet, it is automatically created with five hundred columns and five hundred rows. You can change the number to zero or 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.

    Using the Properties Window

    1. At design time, in the Properties window, select the Spread component.
    2. Select the Sheets property.
    3. Click the button to display the SheetView Collection Editor.
    4. In the Members list, select the sheet for which to set the number of columns or rows.
    5. In the properties list, set the ColumnCount property to set the number of columns and the RowCount property to set the number of rows.
    6. 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
    

    Method to set

    Set the ColumnCount or RowCount property for a SheetView class.

    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

    1. Select the sheet tab for the sheet for which you want to set the number of columns or rows.
    2. 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.
    3. In the list of properties for the columns or rows, set the Count property.
    4. From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer.
    See Also