[]
Gets the ISlicerItem with the specified index.
ISlicerItem this[int index] { get; }
ReadOnly Default Property Item(index As Integer) As ISlicerItem
| Type | Name | Description |
|---|---|---|
| int | index | The zero-based index of the slicer item to retrieve. |
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];
Gets the ISlicerItem with the specified name.
Use this property to retrieve a slicer item from the collection by its item name.
ISlicerItem this[string name] { get; }
ReadOnly Default Property Item(name As String) As ISlicerItem
| Type | Name | Description |
|---|---|---|
| string | name | The name of the slicer item to retrieve. |
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"];