[]
Gets or sets whether the field can be hidden by being dragged off the PivotTable report.
This property indicates whether users can remove the field from the PivotTable report by dragging it away. The default value is true. Set this property to change this setting.
bool DragToHide { get; set; }
Property DragToHide As Boolean
worksheet.Range["A1:C4"].Value = new object[,] {
{"Region", "Product", "Amount"},
{"East", "Apple", 100},
{"West", "Pear", 200},
{"East", "Pear", 150}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:C4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["E1"], "SalesPivot");
IPivotField field = pivotTable.PivotFields["Product"];
field.DragToHide = false;
bool canDragToHide = field.DragToHide;