Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TAdvSpreadGrid
How to show negative values in red within a cell with a formula

This code snippet shows how to have negative values in red within a cell with a formula:

procedure TForm1.AdvSpreadGrid1GetCellColor(Sender: TObject; ARow,
  ACol: Integer; AState: TGridDrawState; ABrush: TBrush; AFont: TFont);
begin
   if AdvSpreadGrid1.CalculatedValue[acol,arow] < 0 then
    AFont.Color := clred;
end;