Skip to main content

TdxSpreadSheetTableView.DeleteColumns(Integer,Integer) Method

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

Declaration

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

Parameters

Name Type
AStartColumn Integer
ACount Integer

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.

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