I’m working with a DBAdvGrid that contains a column called "ValueType", which can have the values "string", "integer", or "boolean".
Depending on this value, the adjacent "Value" column should dynamically display either plain text (for "string" and "integer") or a checkbox (for "boolean").
I attempted to handle this using the OnGetDisplText event. While it generally works, I'm experiencing noticeable flickering.
It appears that OnGetDisplText is being triggered recursively, causing performance issues or instability.
procedure Tadmin_form.gridAppConfigGetDisplText(Sender: TObject; ACol, ARow: Integer; var Value: string);
var
ValueType: string;
begin
if ARow = 0 then
Exit;
if ACol = gridAppConfig.ColumnByFieldName['VALUE'].Index then
begin
ValueType := UpperCase(gridAppConfig.Cells[gridAppConfig.ColumnByFieldName['VALUETYPE'].Index, ARow]);
if ValueType = 'BOOLEAN' then
gridAppConfig.Columns[ACol].CheckBoxField := True
else
gridAppConfig.Columns[ACol].CheckBoxField := False;
end;
end;