[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ISlicerItems.Item

this Property

this[int]

Gets the ISlicerItem with the specified index.

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

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

Examples
worksheet.Range["A1:B4"].Value = new object[,] {
    {"Category", "Value"},
    {"Fruit", 100},
    {"Vegetable", 200},
    {"Fruit", 300}
};
ITable table = worksheet.Tables.Add(worksheet.Range["A1:B4"], true);
ISlicerCache cache = workbook.SlicerCaches.Add(table, "Category");
ISlicerItem item = cache.SlicerItems[0];

this[string]

Gets the ISlicerItem with the specified name.

Use this property to retrieve a slicer item from the collection by its item name.

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

The name of the slicer item to retrieve.

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