Back to Devexpress

PivotTable.ShowColumnHeaders Property

officefileapi-devexpress-dot-spreadsheet-dot-pivottable-4de69400.md

latest6.3 KB
Original Source

PivotTable.ShowColumnHeaders Property

Gets or sets a value indicating whether to apply the style formatting to column headers.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
bool ShowColumnHeaders { get; set; }
vb
Property ShowColumnHeaders As Boolean

Property Value

TypeDescription
Boolean

true , to format column headers; otherwise, false.

|

Remarks

Set the ShowColumnHeaders property to true to apply formatting to the title area of a pivot table where the column names are located. This area is highlighted in the following image.

The appearance of column headers is specified by the TableStyleElementType.HeaderRow, TableStyleElementType.FirstColumnSubheading, TableStyleElementType.SecondColumnSubheading and TableStyleElementType.ThirdColumnSubheading elements of the table style applied to the pivot table.

Example

View Example

csharp
Worksheet worksheet = workbook.Worksheets["Report1"];
workbook.Worksheets.ActiveWorksheet = worksheet;

// Access the pivot table by its name in the collection.
PivotTable pivotTable = worksheet.PivotTables["PivotTable1"];
// Remove formatting from column headers.
pivotTable.ShowColumnHeaders = false;
vb
Dim worksheet As Worksheet = workbook.Worksheets("Report1")
workbook.Worksheets.ActiveWorksheet = worksheet

' Access the pivot table by its name in the collection.
Dim pivotTable As PivotTable = worksheet.PivotTables("PivotTable1")
' Remove formatting from column headers.
pivotTable.ShowColumnHeaders = False

The following code snippets (auto-collected from DevExpress Examples) contain references to the ShowColumnHeaders property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-spreadsheet-pivot-table-api-examples/CS/SpreadsheetWPFPivotTableExamples/CodeExamples/PivotTableFormattingActions.cs#L57

csharp
// Remove formatting from column headers.
pivotTable.ShowColumnHeaders = false;
#endregion #ColumnHeaders

winforms-spreadsheet-pivot-table-api/CS/SpreadsheetPivotTableExamples/CodeExamples/PivotTableFormattingActions.cs#L57

csharp
// Remove formatting from column headers.
pivotTable.ShowColumnHeaders = false;
#endregion #ColumnHeaders

spreadsheet-document-api-pivot-table-examples/CS/SpreadsheetDocServerPivotAPI/CodeExamples/PivotTableFormattingActions.cs#L65

csharp
// Remove formatting from column headers.
pivotTable.ShowColumnHeaders = false;
#endregion #ColumnHeaders

wpf-spreadsheet-pivot-table-api-examples/VB/SpreadsheetWPFPivotTableExamples/CodeExamples/PivotTableFormattingActions.vb#L55

vb
' Remove formatting from column headers.
            pivotTable.ShowColumnHeaders = False
' #End Region ' #ColumnHeaders

winforms-spreadsheet-pivot-table-api/VB/SpreadsheetPivotTableExamples/CodeExamples/PivotTableFormattingActions.vb#L55

vb
' Remove formatting from column headers.
            pivotTable.ShowColumnHeaders = False
' #End Region ' #ColumnHeaders

spreadsheet-document-api-pivot-table-examples/VB/SpreadsheetDocServerPivotAPI/CodeExamples/PivotTableFormattingActions.vb#L59

vb
' Remove formatting from column headers.
            pivotTable.ShowColumnHeaders = False
#End Region ' #ColumnHeaders

See Also

How to: Control Style Options

PivotTable Interface

PivotTable Members

DevExpress.Spreadsheet Namespace