Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

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