Class: TEgFireGrid
Declared in: EgFireGrid
TEgFireGrid = class(TCustomScrollBox)
The data-aware FireMonkey grid. Drop it on a form, set DataSource,
and it shows the records of the dataset, one row per record and one
column per field, or per column of Columns when
that collection is not empty. It is found on the
EasyGate page of the component palette.
The members inherited from the FireMonkey classes
(Align, Anchors, Margins,
Size, Visible, Enabled,
TabOrder, TabStop, CanFocus,
Hint, OnKeyDown, OnKeyUp,
OnEnter, OnExit, and the others) keep their
usual meaning and are not repeated here. The grid takes the focus
(CanFocus and TabStop are True by
default).
Set DataSource to
a TDataSource whose DataSet is any
TDataSet descendant. While Columns is empty
the grid builds one default column per visible field of the dataset, in
the field order, and rebuilds them whenever the dataset’s fields change
(default columns are not stored in the form). Add columns to
Columns (the Columns editor’s Add All
Fields does it for every field) to choose the fields, their
order and their appearance; those are stored in the form.
The grid shows only the records that fit in its height and reads them
through the dataset’s own buffer, as the VCL TDBGrid does:
it never uses RecNo, so it works the same with datasets
that do not number their records.
Many appearance and behaviour settings exist on the grid and on the
column with the same name (Color, CellVAlign,
DateEditor,
MemoMaxChars,
Font, and
others). A column follows the grid’s value until its own is assigned;
from then on the column keeps its own, even when the grid’s changes. The
column’s AssignedValues
tells which are assigned, and RestoreDefaults
makes the column follow the grid (and the field) again.
Every event that concerns a column (clicks on a cell or a title,
drawing a cell or a title, sorting, resizing, moving, check box changes,
picture errors) exists on the grid and on TEgFireGridColumn,
with the same name and the same parameters. The grid’s handler runs
first, then the column’s; neither replaces the other.
Sender is the grid in both.
Events and methods that name a data row do so by its window row:
RowIndex 0 is the first row shown in the grid, not the
first record of the dataset, and the dataset’s active record is not
moved to it. A field of a window row is read with
RowSource.GetValue(RowIndex, FieldName) (see RowSource); to
act on records later, keep their identities from SelectedRowIds.