Skip to main content

TdxSpreadSheetTableViewSelection.SetFocused(Integer,Integer,TShiftState) Method

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

Declaration

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