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

Selects and focuses a single cell within the Table View worksheet.

#Declaration

Delphi
procedure SetFocused(ARow: Integer; AColumn: Integer; AShift: TShiftState);

#Parameters

Name Type
ARow Integer
AColumn Integer
AShift TShiftState

#Remarks

Call this procedure to set the focus to an individual cell whose row and column indexes are passed as the ARow and AColumn parameters. The optional 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 a few consecutive calls of the SetFocused procedure. No matter how many cells are selected by multiple calls of this procedure, only the last cell is focused.

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

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

See Also