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.SelectCell(Integer,Integer,TShiftState) Method

Selects a single specified cell within the Table View worksheet.

#Declaration

Delphi
procedure SelectCell(ARow: Integer; AColumn: Integer; AShift: TShiftState = []);

#Parameters

Name Type
ARow Integer
AColumn Integer
AShift TShiftState

#Remarks

Call this procedure to select an individual cell whose row and column indexes are passed as the ARow and AColumn parameters, respectively. The AShift parameter allows you to emulate an end-user’s action, such as holding down the Ctrl, Alt, and/or Shift keys. With AShift you can select more than one cell with few consecutive calls of the SelectCell method.

The following code selects five non-adjacent cells within the currently active Table View worksheet.

//...
  dxSpreadSheet1.ActiveSheetAsTable.Selection.SelectCell(1, 1);
  dxSpreadSheet1.ActiveSheetAsTable.Selection.SelectCell(1, 3, [ssCtrl]);
  dxSpreadSheet1.ActiveSheetAsTable.Selection.SelectCell(3, 1, [ssCtrl]);
  dxSpreadSheet1.ActiveSheetAsTable.Selection.SelectCell(3, 3, [ssCtrl]);
  dxSpreadSheet1.ActiveSheetAsTable.Selection.SelectCell(2, 2, [ssCtrl]);

The following image demonstates the selected cell pattern as a result of execution of this code.

See Also