[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ITableColumns.Item

this Property

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.

Declaration
ITableColumn this[int index] { get; }
ReadOnly Default Property Item(index As Integer) As ITableColumn
Parameters
Type Name Description
int index

The zero-based index of the column in the collection.

Property Value
Type Description
ITableColumn

The ITableColumn object at the specified index.

Examples
worksheet.Range["A1:B3"].Value = new object[,] {
    {"Name", "Sales"},
    {"Apple", 100},
    {"Orange", 200}
};
ITable table = worksheet.Tables.Add(worksheet.Range["A1:B3"], true);
ITableColumns columns = table.Columns;
ITableColumn salesColumn = columns[1];

this[string]

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

Declaration
ITableColumn this[string name] { get; }
ReadOnly Default Property Item(name As String) As ITableColumn
Parameters
Type Name Description
string name

The column name.

Property Value
Type Description
ITableColumn

The ITableColumn object that corresponds to the specified column name.

Examples
worksheet.Range["A1:B3"].Value = new object[,] {
    {"Product", "Amount"},
    {"Apple", 100},
    {"Pear", 200}
};
ITable table = worksheet.Tables.Add(worksheet.Range["A1:B3"], true);
ITableColumn column = table.Columns["Amount"];