How to: Show and Hide Row and Column Headers
This topic demonstrates how to control column and row headers’ visibility in a worksheet and SpreadsheetControl.
Show or Hide Headers in a Worksheet
Cells in a worksheet are arranged in rows (Worksheet.Rows) and columns (Worksheet.Columns). Each row and column has a unique name (rows use numbers “1”, “2”, “3”,…, “1048576”, and columns use letters “A”, “B”, “C”,…,”XFD”). Row and column names are displayed on a worksheet’s left and top side, respectively. Use the Worksheet.ActiveView.ShowHeadings (WorksheetView.ShowHeadings) property to control row and column headings’ visibility in a worksheet.
Note
Use the WorksheetPrintOptions.PrintHeadings property to specify whether row and column headings should appear in a printout.
// Hide row and column headings in the first worksheet.
workbook.Worksheets[0].ActiveView.ShowHeadings = false;
Show or Hide Headers in the SpreadsheetControl
Use the SpreadsheetViewOptions.ShowColumnHeaders and SpreadsheetViewOptions.ShowRowHeaders properties to show or hide column and row headers in the SpreadsheetControl. These property values influence only the SpreadsheetControl’s appearance and are not saved to a document.
<dxsps:SpreadsheetControl x:Name="spreadsheetControl">
<dxsps:SpreadsheetControl.Options>
<dxsps:SpreadsheetControlOptions>
<dxsps:SpreadsheetControlOptions.View>
<dxsps:SpreadsheetViewOptions ShowColumnHeaders="False" ShowRowHeaders="False"/>
</dxsps:SpreadsheetControlOptions.View>
</dxsps:SpreadsheetControlOptions>
</dxsps:SpreadsheetControl.Options>
</dxsps:SpreadsheetControl>