Back to Devexpress

TdxSpreadSheetTableView.InsertColumns(string,Integer) Method

vcl-dxspreadsheetcore-dot-tdxspreadsheettableview-dot-insertcolumns-x28-system-dot-string-system-dot-integer-x29.md

latest2.7 KB
Original Source

TdxSpreadSheetTableView.InsertColumns(string,Integer) Method

Inserts a specified number of uninitialized columns following the designated column.

Declaration

delphi
procedure InsertColumns(const AColumn: string; ACount: Integer); overload;

Parameters

NameType
AColumnstring
ACountInteger

Remarks

Call this procedure to insert columns following a column whose zero-based index is passed as the AColumn parameter. The ACount parameter specifies the number of inserted columns.

Both uninitialized columns and column objects are shifted to the right to allocate space for inserted columns.

The following code example inserts one column following the first. The image below shows the Table View worksheet appearance before column insertion.

delphi
dxSpreadSheet1.ActiveSheetAsTable.InsertColumns(1, 1);
cpp
dxSpreadSheet1->ActiveSheetAsTable->InsertColumns(1, 1);

The following image shows the Table View worksheet after column insertion.

Invoking the InsertColumns procedure has no effect if the CanInsert function returns False.

Note

Since the InsertColumns procedure cannot create column objects, you may also need to invoke the CreateItem function of the Table View worksheet’s Columns collection in order to work with the inserted columns.

See Also

TdxSpreadSheetTableView.DeleteColumns

TdxSpreadSheetTableView.InsertCells

TdxSpreadSheetTableView.InsertRows

TdxSpreadSheetTableView Class

TdxSpreadSheetTableView Members

dxSpreadSheetCore Unit