Developer

OnStyleText

Occurs when text in column is about to be styled (Font is set).

property OnStyleText: TNxStyleTextEvent read FOnStyleTextEvent write FOnStyleTextEvent;
After reading Cell's value or state FontColor or FontStyle var parameters can be set.

Remarks


This event is similar to OnCellFormating event from NextGrid version 5.

Example


uses NxIntf6, NxTypes6; ... procedure TForm6.NxNumberColumn61StyleText(Sender: TObject; ACol, ARow: Integer; var FontColor: TColor; FillColor: TColor; var FontStyle: TFontStyles; CellValue: INxBase; CellState: TNxCellPaintingState); begin { Here we examine CellValue and decide on style } if CellValue.AsFloat < 50 then FontColor := clRed else if CellValue.AsFloat < 100 then FontColor := clMaroon else if CellValue.AsFloat >= 200 then begin FontColor := clBlue; FontStyle := [fsItalic]; end else begin { Use default } end; end;

See also