Skip to main content
Row

PivotItem.Visible Property

Gets or sets a value indicating whether the item should be displayed in the report.

Namespace: DevExpress.Spreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

bool Visible { get; set; }

Property Value

Type Description
Boolean

true, if the item is visible; otherwise, false.

Remarks

Use the Visible property to control the visibility of items in a PivotTable field. The following example demonstrates how to hide the first item in the “Product” row field.

View Example

Dim worksheet As Worksheet = workbook.Worksheets("Report4")
workbook.Worksheets.ActiveWorksheet = worksheet

' Access the pivot table by its name in the collection.
Dim pivotTable As PivotTable = worksheet.PivotTables("PivotTable1")
' Access items of the "Product" field.
Dim pivotFieldItems As PivotItemCollection = pivotTable.Fields(1).Items

' Hide the first item in the "Product" field.
pivotFieldItems(0).Visible = False

To hide all items in a PivotTable field except one, use the PivotField.ShowSingleItem method.

To restore the display of all hidden items in a pivot field, call the PivotField.ShowAllItems method.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Visible 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.

See Also