Jump to content


Bagong

Member Since 23 Aug 2016
Offline Last Active Dec 01 2021 04:32 AM
-----

Posts I've Made

In Topic: How to Coloring Font base on value in NextDBGrid 6

25 March 2021 - 03:27 AM

 

Probably something like this:

procedure TFLinPM.CoLinStaStyleText(Sender: TObject; ACol, ARow: Integer;
  var FontColor: TColor; FillColor: TColor; var FontStyle: TFontStyles;
  CellValue: INxBase; CellState: TNxCellPaintingState);
begin
 
if ACol = 12 then
  if CellValue.AsString = 'Closed' then
    begin
       FontColor := clGreen;
    end;
end;

 

 

Hi Boki, 

that code will make green color just for its column.

I need the green color in arow with status "Closed".

I have no problem with version 5, cause there was a cellformating event there.


In Topic: How to Coloring Font base on value in NextDBGrid 6

21 March 2021 - 02:16 AM

Hi,

 

You are pretty close to the solution. You just need to set var parameters from this procedure, such as FontColor, FontStyle or FillColor, but not set properties of columns. 

 

could you write the code should be..


In Topic: How to Coloring Font base on value in NextDBGrid 6

20 March 2021 - 12:13 PM

a simple thing, please convert this code (ver 5)

 

procedure TForm1.NextGrid1CellFormating(Sender: TObject; ACol, ARow: Integer; var TextColor: TColor; var FontStyle: TFontStyles; CellState: TCellState);

begin

if (ACol = 3) and not(csSelected in CellState) then

begin

TextColor := clRed;

FontStyle := [fsBold];

end;

end;

 

 

to ver 6th.

 

 

my goal is gives possibility to set custom Font TColor or TFontStyle based on ACol and ARow parameters.


In Topic: color cell in column 1 based upon value in column 2

20 March 2021 - 12:04 PM

Hello,

 

There is an event for Column (you need to select the column) and the you have an event for styling cell text. It have very much the same var parameters.

 

I hope that this helps.

 

 

could you please make an example code


In Topic: How to Coloring Font base on value in NextDBGrid 6

20 March 2021 - 11:51 AM

procedure TFLinPM.CoLinStaStyleText(Sender: TObject; ACol, ARow: Integer;
  var FontColor: TColor; FillColor: TColor; var FontStyle: TFontStyles;
  CellValue: INxBase; CellState: TNxCellPaintingState);
begin
 
  if CellValue.AsString = 'Closed' then
    begin
    GrLin.Cell[ARow,ACol].Color := clGreen;
    GrLin.Cell[ARow,2].Color := clGreen;
    GrLin.Cell[2,ACol].Color := clGreen;
    end;
 
end;
 
 
 
 
i try this, doesnt work too