Grid !!!!
12/03/2003
0
caros colegas estou com o seguinte problema, preciso em um grid quando exibir valores negativos deixa-los em vermelho, alguém sabe como poderia ser feito isto ???
[]´s
Oscar Luiz
[]´s
Oscar Luiz
Oscarluiz
Curtir tópico
+ 0
Responder
Posts
12/03/2003
Anonymous
Coloque a propriedade defaultdrawdata do dbgrid em FALSE
No evento onDrawColumnCell do seu grid coloque o seguinte:
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
If table1PRAZO.Value <0 then // condição
Dbgrid1.Canvas.Font.Color:= clFuchsia; // coloque aqui a cor desejada
Dbgrid1.DefaultDrawDataCell(Rect, dbgrid1.columns[datacol].field, State);
end;
falow
Fernando Souza
Votorantim-SP
No evento onDrawColumnCell do seu grid coloque o seguinte:
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
If table1PRAZO.Value <0 then // condição
Dbgrid1.Canvas.Font.Color:= clFuchsia; // coloque aqui a cor desejada
Dbgrid1.DefaultDrawDataCell(Rect, dbgrid1.columns[datacol].field, State);
end;
falow
Fernando Souza
Votorantim-SP
Responder
Clique aqui para fazer login e interagir na Comunidade :)