Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TFormParcelas.DBGridDadosDrawColumnCell(Sender: TObject; const Rect: TRect;
- DataCol: integer; Column: TColumn; State: TGridDrawState);
- begin
- if(Column.FieldName = 'TOTAL')then
- begin
- DBGridDados.Canvas.Font.Color := clBlack;
- if(Column.Field.AsCurrency > 0) then
- begin
- if(State = [gdSelected])or(State = [gdSelected, gdFocused])then
- begin
- DBGridDados.Canvas.Brush.Color := clRed;
- DBGridDados.Canvas.Font.Color := clWhite;
- end
- else
- begin
- DBGridDados.Canvas.Brush.Color := Riba.VermelhoClaro;
- DBGridDados.Canvas.Font.Color := clBlack;
- end;
- end
- else
- begin
- if(State = [gdSelected])or(State = [gdSelected, gdFocused])then
- begin
- DBGridDados.Canvas.Brush.Color := clGreen;
- DBGridDados.Canvas.Font.Color := clWhite;
- end
- else
- begin
- DBGridDados.Canvas.Brush.Color := Riba.VerdeClaro;
- DBGridDados.Canvas.Font.Color := clBlack;
- end;
- end;
- DBGridDados.Canvas.FillRect(Rect); //Aplica as mudanças
- DBGridDados.DefaultDrawColumnCell(Rect,DataCol,Column,State); //Redesenha os dados na coluna
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement