Code:
procedure TFForma.DBGrid1DrawColumnCell
procedure TFForma.DBGrid1DrawColumnCell
imam slijedeće:
Code:
with Dataset do
begin
Close;
SelectSQL.Text := 'select 1 from tablica where ' +
'nesto= ' + QuotedStr(NekiDataset.FieldByName('sifra').AsString) + ' and oznaka = ''n'' ';
Open;
if RecordCount <> 0 then
Grid.Canvas.Font.Color := clRed;
end;
Grid.DefaultDrawColumnCell(Rect, DataCol, Column, State);
with Dataset do
begin
Close;
SelectSQL.Text := 'select 1 from tablica where ' +
'nesto= ' + QuotedStr(NekiDataset.FieldByName('sifra').AsString) + ' and oznaka = ''n'' ';
Open;
if RecordCount <> 0 then
Grid.Canvas.Font.Color := clRed;
end;
Grid.DefaultDrawColumnCell(Rect, DataCol, Column, State);
i to radi jako sporo. Jasno mi je da on svaki puta kod novog reda ponovo pokreće upit, ali ne vidim kako drukčije da riješim (polje "oznaka" je u drugoj tablici, znači to polje nemam u podacima u gridu). Netko ima ideju, iskustva?
Hvala.
F