How to set the Row Text color in a TwwDBGrid?


1 comment

  • Official comment
    Roy Woll

    You can use the OnCalcCellColors for this. The following example puts the row in red if Customer No is more than 800

    procedure TBtnGridForm.wwDBGrid1CalcCellColors(Sender: TObject; 
    Field: TField; State: TGridDrawState; Highlight: Boolean;
    AFont: TFont; ABrush: TBrush);
    if TwwDBGrid(Sender).DataSource.DataSet.fieldbyname('Customer No').AsInteger>800 then
    ABrush.Color:= clRed;
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk