Back to Devexpress

TableStyleCollection.DefaultPivotStyle Property

officefileapi-devexpress-dot-spreadsheet-dot-tablestylecollection-ba80a7e8.md

latest5.7 KB
Original Source

TableStyleCollection.DefaultPivotStyle Property

Gets or sets the default pivot table style.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
TableStyle DefaultPivotStyle { get; set; }
vb
Property DefaultPivotStyle As TableStyle

Property Value

TypeDescription
TableStyle

A TableStyle object.

|

Remarks

Use the DefaultPivotStyle property to specify the default style for pivot tables that can be used in the following cases.

  • If you create a pivot table and do not explicitly specify a style to be applied to the report, the default style will be automatically applied to the created pivot table.
  • If you remove a style that has been previously applied to a pivot table, the pivot table style will be changed to the default style.

You can set the DefaultPivotStyle property to any pivot table style contained in the collection. If the default pivot table style is not explicitly specified, the PivotStyleLight16 built-in style is used as default. The image below shows the pivot table appearance when the PivotStyleLight16 style is applied.

The following code snippets (auto-collected from DevExpress Examples) contain references to the DefaultPivotStyle 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/PivotTableActions.cs#L26

csharp
// Set the default style for the pivot table.
pivotTable.Style = workbook.TableStyles.DefaultPivotStyle;

winforms-spreadsheet-pivot-table-api/CS/SpreadsheetPivotTableExamples/CodeExamples/PivotTableActions.cs#L45

csharp
// Set the default style for the pivot table.
pivotTable.Style = workbook.TableStyles.DefaultPivotStyle;

spreadsheet-document-api-pivot-table-examples/CS/SpreadsheetDocServerPivotAPI/CodeExamples/PivotTableActions.cs#L55

csharp
// Set the default style for the pivot table.
pivotTable.Style = workbook.TableStyles.DefaultPivotStyle;

wpf-spreadsheet-pivot-table-api-examples/VB/SpreadsheetWPFPivotTableExamples/CodeExamples/PivotTableActions.vb#L27

vb
' Set the default style for the pivot table.
pivotTable.Style = workbook.TableStyles.DefaultPivotStyle

winforms-spreadsheet-pivot-table-api/VB/SpreadsheetPivotTableExamples/CodeExamples/PivotTableActions.vb#L45

vb
' Set the default style for the pivot table.
pivotTable.Style = workbook.TableStyles.DefaultPivotStyle

spreadsheet-document-api-pivot-table-examples/VB/SpreadsheetDocServerPivotAPI/CodeExamples/PivotTableActions.vb#L51

vb
' Set the default style for the pivot table.
pivotTable.Style = workbook.TableStyles.DefaultPivotStyle

See Also

How to: Apply a Predefined Style to a Pivot Table

How to: Apply a Custom Style to a Pivot Table

TableStyleCollection Interface

TableStyleCollection Members

DevExpress.Spreadsheet Namespace