[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ITableColumns

ITableColumns Interface

Represents a collection of all ITableColumn objects in a specified ITable.

Each ITableColumn in the collection represents a column in the table. Use this interface to access table columns by index or name, and to work with the complete set of columns in a table.

Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public interface ITableColumns
Public Interface ITableColumns
Examples
worksheet.Range["A1:B3"].Value = new object[,] {
    {"Name", "Value"},
    {"A", 100},
    {"B", 200}
};
ITable table = worksheet.Tables.Add(worksheet.Range["A1:B3"], true);
ITableColumns columns = table.Columns;
ITableColumn column = columns[0];

Properties

Name Description
Count

Gets the number of ITableColumn objects in the collection.

Use this property to determine how many columns are currently defined in a table.

this[int]

Gets the ITableColumn object at the specified zero-based index.

Use this indexer to retrieve a column from the ITableColumns collection by its current position in the parent ITable.

this[string]

Gets the ITableColumn object that corresponds to the specified column name.

Methods

Name Description
Add(int)

Adds a new column to the table and returns the created ITableColumn.

If position is -1 or omitted, the column is appended to the end of the table; otherwise, it is inserted at the specified zero-based position.

Add(int, int)

Adds one or more columns to the table at the specified relative position.

The position is zero-based. Existing columns at the specified position are shifted outward to make room for the new columns.

Delete(int, int)

Deletes one or more columns from the table.

The position parameter is zero-based and is relative to the table. If count exceeds the number of columns available from position, only the remaining columns are deleted.