Jump to content


Photo

Easiest way to change font style

OnCellFormating equivalent

  • Please log in to reply
9 replies to this topic

#1 AlexMex

AlexMex
  • Members
  • 19 posts

Posted 06 May 2022 - 02:27 PM

Hello Boki,

 

I have an application with a grid displaying a small inventory. If inventory is low I am changing with GetCellColor event the background of the cell. Customer asks me to change the font color / style (red/bold) instead of changing background. I can't find in doc, demo or even my own code how I was doing it in the past. OnCellFormating does not exist any more in v6.

 

Regards,

AlexMex



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 06 May 2022 - 03:39 PM

Hi,

 

For this purpose you can use OnStyleText event that now exists for every column:

procedure TForm1.NxTextColumn61StyleText(Sender: TObject; ACol, ARow: Integer; var FontColor: TColor; FillColor: TColor;
  var FontStyle: TFontStyles; CellValue: INxBase; CellState: TNxCellPaintingState);
begin
  // You can inspect all what you need and set FontStyle or FontColor
end;

boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 06 May 2022 - 03:40 PM

I hope that this helps :)


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#4 AlexMex

AlexMex
  • Members
  • 19 posts

Posted 20 May 2022 - 12:06 PM

Hi Boki,

 

Yes it helps :D. But (there is a nice line in GOT about but  :P ) it does not work for TNxDateColumn6. So I have all the line except two columns in Red. Any suggestion?

 

Best Regards,

AlexMex



#5 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 20 May 2022 - 12:09 PM

Hm, I will check it now. Hopefully is some small tweak.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#6 AlexMex

AlexMex
  • Members
  • 19 posts

Posted 03 August 2022 - 09:58 PM

Hello Boki,

 

I didn't remember this until I got a meeting yesterday where customer asks me about it. Is there an easy tweak? Or not so easy?

 

Regads,

AlexMex



#7 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 03 August 2022 - 10:52 PM

Hi,

 

I’m sorry for delay, I will solve it tomorrow. Stay tumed.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#8 AlexMex

AlexMex
  • Members
  • 19 posts

Posted 10 August 2022 - 09:39 PM

Hello Boki,

 

I will :). That's a critical point for painting grid.

 

BR,

AlexMex



#9 AlexMex

AlexMex
  • Members
  • 19 posts

Posted 16 August 2022 - 06:31 PM

Hello Boki,

 

Any update?

 

Regards,

AlexMex



#10 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 17 August 2022 - 06:44 PM

Hi,

 

Sorry again for delay, I have already fixed it for the next release. But I will send you updated file inside a private message. You will need to recompile NextGrid packages in order to see new event inside the IDE.


boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users