Fórum Colorir a linha no stringgrid dependendo do resultado #130846
22/03/2010
0
Estou tentando conforme o código abaixo mais o trem não funciona de forma alguma
procedure TFrmVisualizaUniCod.GridDrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
begin
inherited;
///
If Grid.Cells[0,0] = 'Entrada Mecadoria' Then
Grid.Canvas.Brush.Color := $00FFEFDF;
{
if (ARow <> 0) and ((ARow mod 2) = 0) then
begin
Grid.Canvas.Brush.Color := $00FFEFDF; // define cor de fundo
Grid.Canvas.FillRect(Rect); // pinta a célula
Grid.Canvas.Font.Color := clBlack;
DrawText(Grid.Canvas.Handle,PChar(Grid.Cells[ACol,
ARow]), - 1, Rect, DT_VCENTER or DT_LEFT or
DT_SINGLELINE);
end; }
///
end;
Douglas Fernandes
Curtir tópico
+ 0Posts
22/03/2010
Emerson Nascimento
Gostei + 0
23/03/2010
Wilson Junior
Espero ter colaborado.
Gostei + 0
23/03/2010
Thiago Santana
Field: TField; AFont: TFont; var Background: TColor; Highlight: Boolean);
begin
if (Sender as TJvDBGrid ).DataSource.DataSet.FieldByName('C_Desativado').AsInteger = 1 then begin
AFont.Color := clRed;
Background := clWhite;
Gostei + 0
23/03/2010
Douglas Fernandes
Emerson estou tentando colorir a linha toda dependendo do que esta na primeira celula
Wilson o link que você postou me parece ser o melhor para trabalhar em cima dele, irei dar uma olhada aqui
e caso funcione irei postar o resultado... valeu
Gostei + 0
23/03/2010
Douglas Fernandes
procedure TFrmVisualizaUniCod.GridDrawCell(Sender: TObject; ACol,
ARow: Integer; Rect: TRect; State: TGridDrawState);
Var
VLinha : Integer;
begin
inherited;
with Grid do
begin
If Cells[10,ARow] = '0' Then
Begin
VLinha := ARow;
Canvas.Font.Color := clBlack;
Case ARow of
0: Canvas.brush.Color:=$00F0FE9E;
1: Canvas.brush.Color:=$00F0FE9E;
2: Canvas.brush.Color:=$00F0FE9E;
3: Canvas.brush.Color:=$00F0FE9E;
4: Canvas.brush.Color:=$00F0FE9E;
5: Canvas.brush.Color:=$00F0FE9E;
6: Canvas.brush.Color:=$00F0FE9E;
7: Canvas.brush.Color:=$00F0FE9E;
8: Canvas.brush.Color:=$00F0FE9E;
9: Canvas.brush.Color:=$00F0FE9E;
End;
End;
End;
Gostei + 0
23/03/2010
Wilson Junior
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)