[]
Gets or sets the number of columns used to display items in the slicer.
Use this property to determine the current slicer layout when slicer items are arranged in multiple columns.
int NumberOfColumns { get; set; }
Property NumberOfColumns As Integer
worksheet.Range["A1:B3"].Value = new object[,] {
{"Product", "Amount"},
{"Apple", 100},
{"Orange", 200}
};
ITable table = worksheet.Tables.Add(worksheet.Range["A1:B3"], true);
ISlicerCache cache = workbook.SlicerCaches.Add(table, "Product", "productCache");
ISlicer slicer = cache.Slicers.Add(worksheet, "productSlicer", "Product", 30, 30, 120, 160);
slicer.NumberOfColumns = 2;
int columnCount = slicer.NumberOfColumns;