Grid !!!!
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
Curtidas 0
Respostas
Anonymous
12/03/2003
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
GOSTEI 0