die daten werden nun wieder korrekt im dbisamgrid angezeigt, die zahlen kleiner 100 sind jedoch nicht in rot...
Delphi-Quellcode:
procedure TForm3.DBISAMDBGrid1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
var
can: TCanvas;
begin
can := (sender as TDBisamDBGrid).Canvas;
if column.Field.FieldName = 'stock' then
begin
DBISAMQuery1.SQL.text := 'select * from stockfabric';
DBISAMQuery1.Open;
if dbisamquery1.FieldByName('stock').Asfloat < 100 then
begin
dbisamdbgrid1.Font.Style := canvas.Font.Style + [fsBold];
dbisamdbgrid1.Font.Color := clred;
end else dbisamDBGrid1.Font.Color := clBlack;
dbisamdbgrid1.Canvas.FillRect(Rect);
dbisamdbgrid1.DrawTextBiDiModeFlags(dbisamdbgrid1.Canvas.Handle);
end;
end;