Back to Devexpress

How to: Show and Hide Row and Column Headings

officefileapi-12396-spreadsheet-document-api-examples-worksheets-how-to-show-and-hide-row-and-column-headings.md

latest2.2 KB
Original Source

How to: Show and Hide Row and Column Headings

  • Sep 19, 2023

Important

You need a license for the DevExpress Office File API Subscription or DevExpress Universal Subscription to use these examples in production code.

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. Refer to the How to: Specify Print Settings document for details on how to specify print options for a worksheet.

View Example

csharp
// Hide row and column headings in the first worksheet.
workbook.Worksheets[0].ActiveView.ShowHeadings = false;
vb
' Hide row and column headings in the first worksheet.
workbook.Worksheets(0).ActiveView.ShowHeadings = False

The image below shows a worksheet’s appearance with visible and hidden row and column headings (the workbook is opened in Microsoft® Excel®).