Back to Devexpress

TcxCustomGridTableController.FocusedRecord Property

vcl-cxgridcustomtableview-dot-tcxcustomgridtablecontroller-6276c682.md

latest3.1 KB
Original Source

TcxCustomGridTableController.FocusedRecord Property

Refers to a record being focused within a View.

Declaration

delphi
property FocusedRecord: TcxCustomGridRecord read; write;

Property Value

Type
TcxCustomGridRecord

Remarks

You can use the FocusedRecord property to access the record being focused within the current View. FocusedRecord represents a TcxCustomGridRecord object which is the base class for all record types in ExpressQuatumGrid : data rows, master data rows, group rows, cards. Refer to the Records section to learn more about this.

The Focused/Selected Records document provides more information.

The following example checks whether a group row is focused. If so, it is expanded and the first data row under the group row is focused.

delphi
var
  AView: TcxCustomGridTableView;
//...
  AView := TcxCustomGridTableView(Grid.FocusedView);
  with AView.Controller do
    if FocusedRecord is TcxGridGroupRow then
    begin
      FocusedRecord.Expand(True);
      FocusedRecordIndex := FocusedRecordIndex +
        AView.GroupedItemCount - FocusedRecord.Level;
    end;
cpp
TcxCustomGridTableView * AView =
  (TcxCustomGridTableView*) Grid->FocusedView;
TcxCustomGridTableController * AController = AView->Controller;
if (dynamic_cast<TcxGridGroupRow*>(AController->FocusedRecord)) {
  AController->FocusedRecord->Expand(true);
  AController->FocusedRecordIndex = AController->FocusedRecordIndex +
    AView->GroupedItemCount - AController->FocusedRecord->Level;
}

See Also

TcxCustomGridRecord.Focused

TcxCustomGridTableController.FocusedRecordIndex

TcxCustomGridTableController.FocusNextRecord

TcxCustomGridTableController.FocusNextRecordWithSelection

TcxCustomGridTableController.FocusRecord

TcxCustomGridTableController.SelectedRecords

Focused/Selected Records

Records

TcxCustomGridTableController Class

TcxCustomGridTableController Members

cxGridCustomTableView Unit