ListObject Class

Represents a list object on a worksheet. The ListObject object is a member of the ListObjects collection. The ListObjects collection contains all the list objects on a worksheet.
Inheritance Hierarchy
SystemObject
  Aspose.Cells.TablesListObject

Namespace:  Aspose.Cells.Tables
Assembly:  Aspose.Cells (in Aspose.Cells.dll) Version: 21.7.0.0 (21.7)
Syntax
public class ListObject

The ListObject type exposes the following members.

Properties
  NameDescription
Public propertyAlternativeDescription
Gets and sets the alternative description.
Public propertyAlternativeText
Gets and sets the alternative text.
Public propertyAutoFilter
Gets auto filter.
Public propertyComment
Gets and sets the comment of the table.
Public propertyDataRange
Gets the data range of the ListObject.
Public propertyDataSourceType
Gets the data source type of the table.
Public propertyDisplayName
Gets and sets the display name.
Public propertyEndColumn
Gets the end column of the range.
Public propertyEndRow
Gets the end row of the range.
Public propertyListColumns
Gets ListColumns of the ListObject.
Public propertyQueryTable
Gets the linked QueryTable.
Public propertyShowHeaderRow
Gets and sets whether this ListObject show header row.
Public propertyShowTableStyleColumnStripes
Indicates whether column stripe formatting is applied.
Public propertyShowTableStyleFirstColumn
Indicates whether the first column in the table should have the style applied.
Public propertyShowTableStyleLastColumn
Indicates whether the last column in the table should have the style applied.
Public propertyShowTableStyleRowStripes
Indicates whether row stripe formatting is applied.
Public propertyShowTotals
Gets and sets whether this ListObject show total row.
Public propertyStartColumn
Gets the start column of the range.
Public propertyStartRow
Gets the start row of the range.
Public propertyTableStyleName
Gets and sets the table style name.
Public propertyTableStyleType
Gets and the built-in table style.
Public propertyXmlMap
Gets an XmlMap used for this list.
Methods
  NameDescription
Public methodApplyStyleToRange
Apply the table style to the range.
Public methodConvertToRange
Convert the table to range.
Public methodConvertToRange(TableToRangeOptions)
Convert the table to range.
Public methodEquals (Inherited from Object.)
Public methodFilter
Filter the table.
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodPutCellValue
Put the value to the cell.
Public methodResize
Resize the range of the list object.
Public methodToString (Inherited from Object.)
Public methodUpdateColumnName
Updates all list columns' name from the worksheet.
Examples
[C#]


Workbook workbook = new Workbook();
Cells cells = workbook.Worksheets[0].Cells;
for (int i = 0; i  <5; i++)
{
cells[0,i].PutValue(CellsHelper.ColumnIndexToName(i));
 }
for (int row = 1; row  <10; row++)
{
 for (int column = 0; column  <5; column++)
{
cells[row, column].PutValue(row * column);
 }
 }
ListObjectCollection tables = workbook.Worksheets[0].ListObjects;
int index = tables.Add(0, 0, 9, 4, true);
ListObject table = tables[0];
table.ShowTotals = true;
table.ListColumns[4].TotalsCalculation = Aspose.Cells.TotalsCalculation.Sum;
workbook.Save(@"C:\Book1.xlsx");


[Visual Basic]

Dim workbook As Workbook = New Workbook()
Dim cells As Cells = workbook.Worksheets(0).Cells
For i As Int32 = 0 To 4
 cells(0, i).PutValue(CellsHelper.ColumnIndexToName(i))
Next
For row As Int32 = 1 To 9
 For column As Int32 = 0 To 4
  cells(row, column).PutValue(row * column)
Next
Next
Dim tables As ListObjectCollection = workbook.Worksheets(0).ListObjects
Dim index As Int32 = tables.Add(0, 0, 9, 4, True)
Dim table As ListObject = tables(0)
table.ShowTotals = True
table.ListColumns(4).TotalsCalculation = Aspose.Cells.TotalsCalculation.Sum
workbook.Save("C:\Book1.xlsx")
See Also