[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotField.DragToData

DragToData Property

DragToData

Gets or sets whether the specified field can be dragged to the data position.

This property indicates whether the field can be moved into the data area of a PivotTable report. The default value is true. Set this property to change this setting.

Declaration
bool DragToData { get; set; }
Property DragToData As Boolean
Examples
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["Amount"];
field.DragToData = false;
bool canDragToData = field.DragToData;