Spread Windows Forms 9.0 Product Documentation > Developer's Guide > Understanding the Spreadsheet Objects > Working with Headers > Showing or Hiding Headers |
By default, Spread displays column headers and row headers. If you prefer, you can turn them off, and hide from view the row headers or column headers or both. The following figure shows a sheet that displays only column headers and hides the row headers.
If the sheet has multiple headers, using these instructions to hide the headers hides all header rows or header columns or both. If you want to hide specific rows or columns within a header, you must specify the row or column. For more details on hiding specific rows or columns, refer to Showing or Hiding a Row or Column.
The display of headers is done by simply setting a visible property of the header. This can be done in code with any of these properties:
Alternatively, you can customize the headers by providing custom text or headers with multiple columns or rows, as explained in Customizing the Default Header Labels and Creating a Header with Multiple Rows or Columns.
Set the ColumnHeaderVisible or RowHeaderVisible property for a Sheets object or the Visible property of the ColumnHeader or RowHeader object.
This example turns off the display of the column header. You can use either line of code.
C# |
Copy Code
|
---|---|
// Turn off the display of column headers. fpSpread1.Sheets[0].ColumnHeaderVisible = false; fpSpread1.Sheets[0].ColumnHeader.Visible = false; |
VB |
Copy Code
|
---|---|
' Turn off the display of column headers. FpSpread1.Sheets(0).ColumnHeaderVisible = False FpSpread1.Sheets(0).ColumnHeader.Visible = False |
This example code sets the first sheet to not display column headers.
C# |
Copy Code
|
---|---|
// Create a new sheet. FarPoint.Win.Spread.SheetView newsheet = new FarPoint.Win.Spread.SheetView(); newsheet.ColumnHeaderVisible = false; // Set first sheet equal to SheetView object. fpSpread1.Sheets[0] = newsheet; |
VB |
Copy Code
|
---|---|
' Create a new sheet. Dim newsheet As New FarPoint.Win.Spread.SheetView() newsheet.ColumnHeaderVisible = False ' Set first sheet equal to SheetView object. FpSpread1.Sheets(0) = newsheet |