Spread ASP.NET 17
Spread for ASP.NET 17 Product Documentation / Developer's Guide / Customizing the Appearance / Customizing the Appearance of Rows and Columns / Showing or Hiding Rows or Columns
In This Topic
    Showing or Hiding Rows or Columns
    In This Topic

    You can hide a row or column so that it is not visible to the user. You can also hide only the row headers or column headers; follow the procedures in Showing or Hiding Headers.

    When you hide a row or column, the value of the row height or column width is kept by the fpSpread component. If you display the row or column again, it is displayed at the value it was before it was hidden. The data is still available to other parts of the sheet; the only change is that the row or column is not displayed.

    If you want to remove the row or column, refer to Removing a Row or Column.

    Using a Shortcut

    Set the Visible property for the Row shortcut object or the Visible property for the Column shortcut object, or use the SetRowVisible or SetColumnVisible method in the SheetView object.

    Example

    This example code hides the second row and hides the third column.

    C#
    Copy Code
    FpSpread1.Sheets[0].SetRowVisible(1, false);
    FpSpread1.Sheets[0].SetColumnVisible(2, false); 
    
    VB
    Copy Code
    FpSpread1.Sheets[0].SetRowVisible(1, false)
    FpSpread1.Sheets[0].SetColumnVisible(2, false) 
    

    Using Code

    Set the SetRowVisible or SetColumnVisible method in the SheetView object.

    Example

    This example code sets the first sheet to have 100 rows and 10 columns.

    C#
    Copy Code
    FarPoint.Web.Spread.SheetView sv;
    sv = FpSpread1.ActiveSheetView;
    sv.SetRowVisible(1, false);
    sv.SetColumnVisible(2, false); 
    
    VB
    Copy Code
    Dim sv As FarPoint.Web.Spread.SheetView
    sv = FpSpread1.ActiveSheetView
    sv.SetRowVisible(1, False)
    sv.SetColumnVisible(2, false) 
    

    Using the Spread Designer

    1. In Spread Designer, select the row or column.
    2. In the properties window, set the Visible property to false.
    3. Click Apply and Exit to close the Spread Designer.