QuantumGrid - ownerdraw cxGrid |
Top Previous Next |
|
// Owner Draw cxGrid // DadosSecao = Coluna da grid que ser quer testar o valor procedure TForm1.DadosCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean); var Valor: String; const CorNormal = clBlack; CorNormalComFoco = clWhite; CorDiferente = clRed; CorDiferenteComFoco = $00DFDFFF; begin Valor := VarAsType(AViewInfo.GridRecord.DisplayTexts[DadosSECAO.Index], varString); if Pos('FRIOS', Valor) > 0 then begin if AViewInfo.Selected then ACanvas.Canvas.Font.Color := CorDiferenteComFoco else ACanvas.Canvas.Font.Color := CorDiferente; end else if AViewInfo.Selected then ACanvas.Canvas.Font.Color := CorNormalComFoco else ACanvas.Canvas.Font.Color := CorNormal; end; |