Hola Foro, que tal, tengo un duda de un mal funcionamiento en el DBGrid, (no por el comp, sino por mi programación). Tengo un cds con un campo que tiene un valor y dependiendo de ese valor pongo el color de la fila. En el sig codigo que hice me hace esto , como me muestra en la imagen adjunto. Este es el codigo:
Ojo esto tiene un timer que va actualizando a cada rato el cds .
Código Delphi
[-] with Sender as TDBGrid do
begin
case cdsDes['OR_TIPO'] of
1: begin
Canvas.Brush.Color := tCOLOR(SELF.cdsDesTIO_COLOR.AsString);
DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
2: begin
Canvas.Brush.Color := tCOLOR(SELF.cdsDesTIO_COLOR.AsString);
DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
3: begin
Canvas.Brush.Color := tCOLOR(SELF.cdsDesTIO_COLOR.AsString);
DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
5: begin
Canvas.Brush.Color := tCOLOR(SELF.cdsDesTIO_COLOR.AsString);
DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
6: begin
Canvas.Brush.Color := tCOLOR(SELF.cdsDesTIO_COLOR.AsString);
DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
else
begin
Canvas.Brush.Color := tCOLOR(SELF.cdsDesTIO_COLOR.AsString);
DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
Miren que busque pero no puedo hacerlo funcionar.
Muchas gracias por su atencion
Saludos
Rodrigo Iñiguez