Back to Devexpress

TdxSpreadSheetTableView.DeleteColumns(Integer,Integer) Method

vcl-dxspreadsheetcore-dot-tdxspreadsheettableview-dot-deletecolumns-x28-system-dot-integer-system-dot-integer-x29.md

latest2.7 KB
Original Source

TdxSpreadSheetTableView.DeleteColumns(Integer,Integer) Method

Removes a specified number of columns starting from a designated column.

Declaration

delphi
procedure DeleteColumns(AStartColumn: Integer; ACount: Integer);

Parameters

NameType
AStartColumnInteger
ACountInteger

Remarks

Use this procedure to remove one or more columns starting from a column index passed as the AStartColumn parameter. The ACount parameter specifies a number of deleted columns. The adjacent columns are shifted left to populate the vacant space.

The following code example deletes entire columns which were occupied by the selected cells. The image below demonstrates the Table View worksheet before cell deletion.

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

The following image displays the Table View worksheet after the deletion of two columns.

If at least one deleted column intersects the array formula result area, the DeleteColumns procedure raises the EdxSpreadSheetCannotChangePartOfArrayError exception.

To insert the specified number of columns, invoke the InsertColumns procedure.

Note

Invoking the DeleteColumns procedure has no effect if the CanDelete function returns False.

See Also

TdxSpreadSheetTableView.DeleteCells

TdxSpreadSheetTableView.DeleteRows

TdxSpreadSheetTableView Class

TdxSpreadSheetTableView Members

dxSpreadSheetCore Unit