Spread for ASP.NET 8.0 Product Documentation > Developer's Guide > Customizing the Appearance > Customizing the Appearance of Rows and Columns > Showing or Hiding Rows or Columns |
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 "remembered" 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.
You can set the display of a sheet to display a particular row as the top row. Use the SheetView.TopRow property.
If you want to remove the row or column, refer to Removing a Row or Column.
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.
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) |
Set the SetRowVisible or SetColumnVisible method in the SheetView object.
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) |