ListObject
Overview
ListObject is a class in Aspose.Cells FOSS for .NET.
Represents an Excel table (structured reference / ListObject). Tables provide structured data with built-in filtering, sorting, and styling. They automatically create filters for table headers and support various table styles. Tables can include header rows, total rows, and banding for better readability. Structured references allow you to reference table data by name in formulas. var workbook = new Workbook(); var worksheet = workbook.Worksheets[0]; // Add sample data worksheet.Cells[“A1”].PutValue(“Name”); worksheet.Cells[“B1”].PutValue(“Age”); worksheet.Cells[“A2”].PutValue(“Alice”); worksheet.Cells[“B2”].PutValue(30); // Create a table int tableIndex = worksheet.ListObjects.Add(0, 0, 2, 1, true); var table = worksheet.ListObjects[tableIndex]; table.DisplayName = “People Data”; table.ShowHeaderRow = true;
This class provides 4 methods for working with ListObject objects in .NET programs.
Available methods include: ConvertToRange, RemoveAutoFilter, Resize, ShowAutoFilter.
All exported members are accessible to any .NET application after installing the Aspose.Cells FOSS for .NET package.
Properties: Comment, DisplayName, EndColumn, EndRow, ListColumns, ShowHeaderRow, and 9 more.
Description
ListObject is a class in the Aspose.Cells FOSS library for .NET that exposes 4 methods and 15 properties for programmatic use.
The class also provides the StartRow property (gets the start row), the StartColumn property (gets the start column), the EndRow property (gets the end row).
Properties
| Name | Type | Access | Description |
|---|---|---|---|
DisplayName | string | Read/Write | Gets or sets the display name. |
Comment | string | Read/Write | Gets or sets the comment. |
StartRow | int | Read | Gets the start row. |
StartColumn | int | Read | Gets the start column. |
EndRow | int | Read | Gets the end row. |
EndColumn | int | Read | Gets the end column. |
ShowHeaderRow | bool | Read/Write | Gets or sets the show header row. |
ShowTotals | bool | Read/Write | Gets or sets the show totals. |
TableStyleType | TableStyleType | Read/Write | Gets or sets the table style type. |
TableStyleName | string | Read/Write | Gets or sets the table style name. |
ShowTableStyleFirstColumn | bool | Read/Write | Gets or sets the show table style first column. |
ShowTableStyleLastColumn | bool | Read/Write | Gets or sets the show table style last column. |
ShowTableStyleRowStripes | bool | Read/Write | Gets or sets the show table style row stripes. |
ShowTableStyleColumnStripes | bool | Read/Write | Gets or sets the show table style column stripes. |
ListColumns | ListColumnCollection | Read | Gets the list columns. |
Methods
| Signature | Description |
|---|---|
Resize(startRow: int, startColumn: int, endRow: int, endColumn: int, hasHeaders: bool) | Resizes the table to the specified range, rebuilding columns from header cells. |
ShowAutoFilter() | Shows the autoFilter drop-down buttons on the table header row. |
RemoveAutoFilter() | Hides the autoFilter drop-down buttons from the table header row. |
ConvertToRange() | Removes the table structure, leaving the cell data in place. |