TAdvStringGrid
Example 60 : Using data dependent images with TAdvStringGrid

procedure TForm1.AdvStringGrid1GetDisplText(Sender: TObject; ACol, ARow: Integer; var Value: String); var oldvalue: string; begin oldvalue := value; if (ACol = 1) and (ARow > 0) then begin if value = 'Y' then value := '1' else value := '0'; end; end;
With this one event handler, we can set images through:
advstringgrid1.Cells[1,1] := 'N'; advstringgrid1.Cells[1,2] := 'Y';
and just use the text that is most convenient for maintaining in the rest of the application.
Delphi project & source files for downloading included in the main demos distribution for Delphi.
×