[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotItem.Position

Position Property

Position

Gets or sets the position of the pivot item within its parent field when the item is currently shown.

This value indicates the displayed order of the item in the field.

Declaration
int Position { get; set; }
Property Position As Integer
Examples
worksheet.Range["A1:B4"].Value = new object[,] {
    {"Product", "Amount"},
    {"Apple", 100},
    {"Banana", 80},
    {"Carrot", 120}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"], "SalesPivot");
IPivotField field = pivotTable.PivotFields["Product"];
field.Orientation = PivotFieldOrientation.RowField;
int position = field.PivotItems["Apple"].Position;