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

TdxSpreadSheetTableViewSelection.SelectColumns(Integer,Integer,TShiftState) Method

Selects a single column or a range of columns within the Table View worksheet.

#Declaration

Delphi
procedure SelectColumns(AStartColumn: Integer; AFinishColumn: Integer; AShift: TShiftState = []);

#Parameters

Name Type
AStartColumn Integer
AFinishColumn Integer
AShift TShiftState

#Remarks

Call this procedure to select one or more columns. Indexes of the first and last column in the selected range are passed as the AStartColumn and AFinishColumn parameters, respectively. To select a single column, pass the same value as both parameters. The optional AShift parameter allows you to emulate an end-user’s actions such as holding down the Ctrl, Alt, and/or Shift keys. With AShift you can select more than one column range with a few consecutive calls of the SelectColumns procedure.

The following code example selects two column ranges within the currently active Table View worksheet.

//...
  dxSpreadSheet1.ActiveSheetAsTable.Selection.SelectColumns(1, 1);
  dxSpreadSheet1.ActiveSheetAsTable.Selection.SelectColumns(3, 4, [ssCtrl]);

Note

If you need to select either a row or range of rows, use the SelectRows procedure.

See Also