[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ITable

ITable Interface

Represents a table object on a worksheet.

An ITable defines a structured data region that can include a header row, data rows, totals, filtering, sorting, and table-specific formatting. Calling Add(IRange, bool) to add a table to a worksheet returns an ITable object.

Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public interface ITable
Public Interface ITable
Examples
worksheet.Range["A1:B3"].Value = new object[,] {
    {"Name", "Value"},
    {"Test", 100},
    {"Hello", 200}
};
ITable table = worksheet.Tables.Add(worksheet.Range["A1:B3"], true);
table.DisplayName = "Table1";

Properties

Name Description
AutoFilter

Gets the IAutoFilter for this table.

The returned auto filter represents the filtering settings that apply to the table range.

AutoGenerateColumns

Gets or sets whether the table generates columns automatically when it is bound to a data source.

When this property is true, the table can create columns from the fields in the bound data source during data binding.

BindingPath

Gets or sets the binding path of the current table.

The binding path identifies the data path used when the table is bound to a data source.

Columns

Gets the collection of columns in this ITable.

The returned ITableColumns collection contains all columns that belong to the table, including their names and data ranges.

Comment

Gets the comment associated with the table object.

This property returns the text previously assigned through Comment for the current table.

DataRange

Gets the IRange that represents the data area of the table.

The returned range contains the table rows between the header row and the insert row. It does not include the header row.

DisplayName

Gets or sets the display name of this ITable.

The display name is the user-facing name of the table.

ExpandBoundRows

Gets or sets whether the table can add or delete entire worksheet rows during data binding.

This property indicates whether the table is allowed to expand or shrink by whole rows when its bound data changes.

HeaderRange

Gets the IRange object that represents the header row of the table.

Use this property to access the cells that contain the table column headers.

Name

Gets or sets the name of the table.

Use this property to get or set the table name that identifies the table in the worksheet.

Range

Returns the IRange object that represents the range to which the specified table object applies.

Rows

Gets the collection of data rows in this ITable.

The returned ITableRows object contains the ITableRow objects that belong to the table data area.

ShowAutoFilter

Gets or sets whether the AutoFilter is displayed.

This property is true only when the table headers are displayed and AutoFilter is enabled for the table.

ShowAutoFilterDropDown

Gets or sets whether the table filter button is visible.

This property indicates whether the drop-down buttons are shown in the table header row.

ShowHeaders

Gets or sets whether the header row is displayed for this ITable.

Use this property to get or set whether the table displays a header row containing column names.

ShowTableStyleColumnStripes

Gets or sets whether the column stripe table style is applied to this ITable.

When this property is true, the applied table style uses alternating formatting for table columns.

ShowTableStyleFirstColumn

Gets or sets whether the first-column table style element is applied.

This property indicates whether the first-column special style element from the applied table style is used for the current ITable; it does not control whether the entire table style is applied to the first column.

ShowTableStyleLastColumn

Gets or sets whether the last-column table style element is applied.

This property indicates whether the last-column special style element from the applied table style is used for the current ITable; it does not control whether the entire table style is applied to the last column.

ShowTableStyleRowStripes

Gets or sets whether banded rows are displayed for this ITable.

When this property is true, the applied table style uses alternating row formatting.

ShowTotals

Gets or sets whether the totals row is visible.

Use this property to get or set whether the table currently displays a totals row.

Sort

Gets the sort settings for this ITable.

The returned ISort object provides access to the sort fields and sort order applied to the table data. After configuring the sort fields, call Apply() to sort the table.

TableStyle

Gets or sets the table style applied to the table.

Use this property to apply or retrieve a built-in or custom table style for the table.

TotalsRange

Gets the totals row range of the table.

Returns the IRange that represents the totals row of this ITable when the totals row is visible.

Methods

Name Description
ConvertToRange()

Converts this table to a regular range of cells.

After calling this method, the cells remain on the worksheet as normal range data instead of being managed as an ITable.

Delete()

Deletes this ITable object and clears the cell data from the worksheet.

Use this method to remove both the table definition and the cells covered by the table. To keep the data and remove only the table object, use ConvertToRange() instead.

FromJson(string)

Generates the table from the specified JSON string.

Resize(IRange)

Resizes this ITable to a new range without inserting or moving cells.

The new range must remain on the same header row as the current table and must overlap the current table range. This method does not rearrange worksheet cells; it only updates the table boundary.

ToJson()

Generates a JSON string from the table.