OnGetVariableValue

Class: TEgFireGrid

property OnGetVariableValue: TEgFireGridGetVariableValueEvent;

TEgFireGridGetVariableValueEvent = procedure(Sender: TObject; const VarID: string; var Value: string) of object;

Supplies the value of a <var>VarID</var> marker that does not name a field of the row.

Markers can be used in the cell texts (the field’s own text or the one an OnBeforeDrawCell handler gives; not in memo columns), in the titles and in the subtitles; <br> stands for a line break. In a cell, a VarID that is the name of a field is replaced by that field’s display text in the same row, without the event; any other name, and every name in a title or a subtitle (which belong to no row), asks this event. Value arrives empty; without a handler the marker is replaced by nothing. Names and tags ignore case; a malformed marker stays as literal text, and a value is not scanned for markers again.

VariableRowIndex tells the window row the marker belongs to (-1 in a title), so the handler can compute a value of that row.

procedure TForm1.Grid1GetVariableValue(Sender: TObject; const VarID: string; var Value: string);
begin
  if SameText(VarID, 'Today') then
    Value := DateToStr(Date);
end;

See Also

(C) 2026 Easygate, Lda