Recent

Author Topic: [SOLVED] Stringgrid - count cell rows with bold and red numbers in a column  (Read 1079 times)

JD

  • Hero Member
  • *****
  • Posts: 1905
Hi there everyone,

I have a stringgrid and I'm trying to count the number of cell rows with bold and red numbers in the first column.

Can anyone help me out, please.

Cheers,

JD
« Last Edit: August 25, 2021, 09:52:05 pm by JD »
Linux Mint - Lazarus 4.0/FPC 3.2.2,
Windows - Lazarus 4.0/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Stringgrid - count cell rows with bold and red numbers in a column
« Reply #1 on: August 25, 2021, 07:34:49 pm »
Hi!

Never use some display attributes for the internal logic.
Keep the display and the logic separate.

There must be some boolean decision if you want to display a cell bold and red.
That is the location to count these cells.

Winni

JD

  • Hero Member
  • *****
  • Posts: 1905
Re: Stringgrid - count cell rows with bold and red numbers in a column
« Reply #2 on: August 25, 2021, 09:51:35 pm »
Hi!

Never use some display attributes for the internal logic.
Keep the display and the logic separate.

There must be some boolean decision if you want to display a cell bold and red.
That is the location to count these cells.

Winni

Thanks for the reminder. I finally gor it to work based on what you advised.

Cheers,

JD
Linux Mint - Lazarus 4.0/FPC 3.2.2,
Windows - Lazarus 4.0/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

 

TinyPortal © 2005-2018