[]
You can choose to show or hide rows and columns in a sheet by following one of the methods below:
Set the Row.Visible property or Column.Visible property. The properties accept boolean values and hide a row or column when set to false.
Set the SetColumnVisible or SetRowVisible methods of SheetView class to show or hide rows and columns.
Set the row height or column width to zero by using the RowHeight and ColumnWidth properties.
!type=note
Note: You can also hide row headers and column headers. For more information, refer to Showing or Hiding Headers.
The following code sample demonstrates the use of SheetView methods as well as Rows and Columns properties to hide the first row and the second column.
//Using SheetView methods to set visibility
fpSpread1.Sheets[0].SetColumnVisible(1,false);
fpSpread1.Sheets[0].SetRowVisible(0,false);
//Another option - use the Visible property.
fpSpread1.Sheets[0].Columns[1].Visible = false;
fpSpread1.Sheets[0].Rows[0].Visible = false;
//Another option - set row height or column width to zero.
GrapeCity.Spreadsheet.IWorksheet sheet1 = fpSpread1.AsWorkbook().ActiveSheet
sheet1.Columns[1].ColumnWidth = 0;
sheet1.Rows[0].RowHeight = 0;
'Using SheetView methods to set visibility
fpSpread1.Sheets(0).SetColumnVisible(1, False)
fpSpread1.Sheets(0).SetRowVisible(0, False)
'Another option - use the Visible property.
fpSpread1.Sheets(0).Columns(1).Visible = False
fpSpread1.Sheets(0).Rows(0).Visible = False
'Another option - set row height or column width to zero.
GrapeCity.Spreadsheet.IWorksheet sheet1 = fpSpread1.AsWorkbook().ActiveSheet
sheet1.Columns(1).ColumnWidth = 0
sheet1.Rows(0).RowHeight = 0
!type=note
Note: To know more about showing or hiding rows and columns by setting row height and column width, refer to Setting the Row Height or Column Width.
By default, the width and height of hidden columns and rows are displayed by about 1 pixel when set to hidden. To eliminate this display, you need to set ResizeZeroIndicator to Default.
When you hide a row or column, the size of the row or column is remembered by the Spread component. If you re-display the row or column, it is displayed at the size it was before it was hidden.
Conversely, you can also prevent the user to re-display the hidden rows or columns by setting the Row.Resizable or Column.Resizable properties to false.
If you want to determine if a row or column is presently visible to the user, that is, whether it appears in the viewport that is currently being displayed, you can use the FpSpread class methods. For more information refer to Customizing Viewports.
At design time, in the Properties window, select the Spread component.
Select the Sheet collection.
Select the Row or Column collection.
Click on a row or column to select it and then select an option from the drop-down combo list for the Visible property.
Select the row or column by clicking on the header.
Select an option from the Visible drop-down combo list.
From the File menu, select Save and Exit to save the changes.
Customizing the Number of Rows or Columns
Setting the Row Height or Column Width
Setting Fixed (Frozen) Rows or Columns
Rows or Columns That Have Data
Adding a Tag to a Row or Column
Customizing the Number of Rows or Columns
Setting the Row Height or Column Width
Setting Fixed (Frozen) Rows or Columns