Class: TEgFireGrid
function SelectedRowIds: TArray<TEgFireGridRowId>;
Returns the identities of the rows of the multi-selection
(egoMultiSelect in Options), in no
particular order. With a dataset, an identity is the record’s bookmark.
Rows deleted from the dataset since they were selected are left out and
removed from the selection (firing OnSelectionChange
if there were any).
The selection is kept by identity, not by position, so it survives
scrolling, sorting and filtering. To act on the selected records, make
each one the active record with RowSource.GotoRowId, or set
the dataset’s Bookmark:
var
Ids: TArray<TEgFireGridRowId>;
Id: TEgFireGridRowId;
begin
Ids := Grid1.SelectedRowIds;
Table1.DisableControls;
try
for Id in Ids do
if Grid1.RowSource.GotoRowId(Id) then
Table1.Delete;
finally
Table1.EnableControls;
end;
end;
TEgFireGridRowId is declared in the unit
EgFireGrid.RowSource, which the unit using it must name in
its uses clause. See Example 7.