[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ISlicerCaches.Item

this Property

this[int]

Gets the ISlicerCache at the specified index.

Use this indexer to retrieve a slicer cache by its zero-based position in the workbook's ISlicerCaches collection.

Declaration
ISlicerCache this[int index] { get; }
ReadOnly Default Property Item(index As Integer) As ISlicerCache
Parameters
Type Name Description
int index

The zero-based index of the slicer cache to retrieve.

Examples
worksheet.Range["A1:B3"].Value = new object[,] {
    {"Product", "Category"},
    {"Apple", "Fruit"},
    {"Carrot", "Vegetable"}
};
ITable table = worksheet.Tables.Add(worksheet.Range["A1:B3"], true);
workbook.SlicerCaches.Add(table, "Category", "categoryCache");
ISlicerCache slicerCache = workbook.SlicerCaches[0];

this[string]

Gets the ISlicerCache with the specified name.

Use this indexer to retrieve a slicer cache that has already been added to the workbook's ISlicerCaches collection.

Declaration
ISlicerCache this[string name] { get; }
ReadOnly Default Property Item(name As String) As ISlicerCache
Parameters
Type Name Description
string name

The name of the slicer cache to retrieve.

Examples
worksheet.Range["A1:B4"].Value = new object[,] {
    {"Category", "Amount"},
    {"Fruit", 100},
    {"Vegetable", 200},
    {"Fruit", 150}
};
ITable table = worksheet.Tables.Add(worksheet.Range["A1:B4"], true);
workbook.SlicerCaches.Add(table, "Category", "categoryCache");
ISlicerCache slicerCache = workbook.SlicerCaches["categoryCache"];