ahora si.
Código Delphi
[-]
procedure TForm1.FormCreate(Sender: TObject);
begin
Query.Open;
end;
procedure TForm1.QueryAfterOpen(DataSet: TDataSet);
var
nValorAnt: Integer;
lColor: Boolean;
begin
nValorAnt := 0;
lColor := False;
mTabla.Open;
while not Query.Eof do
begin
if QueryID_GRUPO.AsInteger <> nValorAnt then
begin
nValorAnt := QueryID_GRUPO.AsInteger;
lColor := not lColor;
mTabla.Append;
mTablaAsiento.Value := nValorAnt;
mTablaCOLOR.Value := lColor;
mTabla.Post;
end;
Query.Next;
end;
mTabla.SortOnFields('ASIENTO');
Query.First;
Grilla.DataSource := DataSource1;
end;
procedure TForm1.GrillaDrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
FColor, BColor: TColor;
begin
if mTabla.Locate('ASIENTO', QueryID_GRUPO.AsInteger, []) then if mTablaCOLOR.AsBoolean then
begin
FColor := clWhite;
BColor := clGreen;
end
else
begin
FColor := clBlack;
BColor := clWhite;
end;
TJvDBUltimGrid(Sender).Canvas.Font.Color := FColor;
TJvDBUltimGrid(Sender).Canvas.Brush.Color := BColor;
TJvDBUltimGrid(Sender).DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
...
con una tablita auxiliar, funciona, no se si te será practico o no.
estoy convencido que la mosca la mate, ahora no se como te quedo la casa
Saludos.