Hi boki, i am stll waiting the new version.
And now i want to know how to Coloring Font base on value in NextDBGrid 6..
in next dbgrid 5, there was OnCellColoring or OnCellFormating.
Posted 19 May 2019 - 05:12 PM
Hi boki, i am stll waiting the new version.
And now i want to know how to Coloring Font base on value in NextDBGrid 6..
in next dbgrid 5, there was OnCellColoring or OnCellFormating.
Posted 19 May 2019 - 05:20 PM
Hi,
You can use next event. This event is located in Column:
procedure TForm1.NxTextColumn61StyleText(Sender: TObject; ACol, ARow: Integer; var FontColor: TColor; FillColor: TColor; var FontStyle: TFontStyles; CellValue: INxBase; CellState: TNxCellPaintingState); begin // Set some of var parameters end;
Posted 19 May 2019 - 05:21 PM
PS. Also add NxIntf6, NxTypes6 in uses section.
Posted 14 March 2021 - 03:51 PM
Hi,
You can use next event. This event is located in Column:
procedure TForm1.NxTextColumn61StyleText(Sender: TObject; ACol, ARow: Integer; var FontColor: TColor; FillColor: TColor; var FontStyle: TFontStyles; CellValue: INxBase; CellState: TNxCellPaintingState); begin // Set some of var parameters end;Boki, could you please explain more with example..
i need coloring rows with content "close"
Posted 15 March 2021 - 03:31 AM
i mean, all row will be change color if that column value is defined
Posted 15 March 2021 - 12:16 PM
Hello,
You can also check ARow parameter and depending on its value do the change.
Posted 20 March 2021 - 10:54 AM
Hello,
You can also check ARow parameter and depending on its value do the change.
Boki,
please correct me in this code..
Posted 20 March 2021 - 11:51 AM
Posted 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.
Posted 20 March 2021 - 04:58 PM
Boki,
please correct me in this code..
procedure TFLinPM.CoLinStaStyleText(Sender: TObject; ACol, ARow: Integer;var FontColor: TColor; FillColor: TColor; var FontStyle: TFontStyles;CellValue: INxBase; CellState: TNxCellPaintingState);beginif ACol = 12 thenif CellValue.AsString = 'Closed' thenbeginGrLin.Columns[1].Font.Color := clGreen; // <--- replace with FontColor := clGreen;end;end;
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.
Posted 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..
Posted 24 March 2021 - 11:05 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;
Posted 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.
Posted 02 April 2021 - 11:57 AM
Hi,
This still should work only if value is “Closed”.
0 members, 0 guests, 0 anonymous users