.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

PivotItem.Visible Property

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

Namespace: DevExpress.Spreadsheet

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


bool Visible { get; set; }
Property Visible As Boolean

Property Value

Type Description

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


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.

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.

See Also