Jump to content


Photo

How to set font color of cell without using events?


  • Please log in to reply
17 replies to this topic

#1 Thomas Steinmaurer

Thomas Steinmaurer
  • Members
  • 131 posts

Posted 14 October 2010 - 11:10 PM

Hello,

I can set the background color of a cell with the TCell.Color property. There is also a TCell.FontStyle property. But how do I set the font color of a cell without using e.g. the OnCellFormatting event? I don't see a TCell.Font property or such.

Thanks,
Thomas
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and NexusDB V2
Upscene Productions: http://www.upscene.com
My blog: http://blog.upscene.com/thomas/

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 14 October 2010 - 11:35 PM

Hello Thomas,

Unfortunately only way is to use OnCellFormating event. I have decide to not put this property to the cell, to save on memory.

Best regards
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 Thomas Steinmaurer

Thomas Steinmaurer
  • Members
  • 131 posts

Posted 14 October 2010 - 11:40 PM

Hi,

ehm, ok. Even if just providing a TColor based property FontColor or TextColor without the entire TFont type? Pretty much the same as you are doing with FontStyle or Color or ActualFontColor etc? IMHO a bit weird that I can read the actual font color, set the background color etc. but not the cell font color directly.

Thanks,
Thomas
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and NexusDB V2
Upscene Productions: http://www.upscene.com
My blog: http://blog.upscene.com/thomas/

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 15 October 2010 - 12:19 AM

Hello Thomas,

I am still considering about adding this property to the Cell, but I am not yet decided.

I know that these days memory is cheap, but I like to keep grid lite.

Best regards
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.

#5 Thomas Steinmaurer

Thomas Steinmaurer
  • Members
  • 131 posts

Posted 15 October 2010 - 12:36 AM

Hi!

Adding such a property would be much appreciated! ;-)

To elaborate on why I think it would be useful. After adding a row and its column values, I run code to adjust coloring and formatting depending on columns values. While I could use the events for that, from my understanding, these events get called A LOT, thus when running perhaps a bit of lengthy code in these events will slow-down displaying the grid A LOT as well. Thus, I thought applying coloring/formatting rules on cells after adding the row only ONCE would be a great win. It is for the background cell color and the font styles! The only missing piece to avoid the OnCellFormatting event is to have a direct way to set the text color. ;-)


Thanks,
Thomas
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and NexusDB V2
Upscene Productions: http://www.upscene.com
My blog: http://blog.upscene.com/thomas/

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 15 October 2010 - 12:54 AM

Hello Thomas,

I will need to think a little bit more. I understand your concerns.

Best regards
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.

#7 AIM

AIM

    Senior Member

  • Honorable Members
  • PipPip
  • 202 posts

Posted 15 October 2010 - 10:01 AM

QUOTE
Adding such a property would be much appreciated! ;-)


+1

Just an idea, but you could add custom cell formatting dynamically. While the default value is nil, there shouldn't be a difference in speed and memory usage. When a value (pointer to TOptionalCellFormatting or whatsoever) is assigned, the custom cell formattings are applied.

BTW, I often use the TNxHtmlColumn for custom cell text color and formattings and never had a performance or memory problem with that smile.gif

#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 16 October 2010 - 07:15 PM

Hello,

I have decide to add TextColor property to the Cell.

It will be ready for next release.

Best regards
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.

#9 Thomas Steinmaurer

Thomas Steinmaurer
  • Members
  • 131 posts

Posted 16 October 2010 - 07:22 PM

HERO!!! biggrin.gif


Thomas
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and NexusDB V2
Upscene Productions: http://www.upscene.com
My blog: http://blog.upscene.com/thomas/

#10 Thomas Steinmaurer

Thomas Steinmaurer
  • Members
  • 131 posts

Posted 23 November 2010 - 12:35 AM

Hello Boki,

any time-frame when a new release with this enhancement will be available?

Thanks,
Thomas
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and NexusDB V2
Upscene Productions: http://www.upscene.com
My blog: http://blog.upscene.com/thomas/

#11 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 27 November 2010 - 03:10 AM

Hello Thomas,

If you want, I may send you development release to test it.

Best regards
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.

#12 Thomas Steinmaurer

Thomas Steinmaurer
  • Members
  • 131 posts

Posted 28 November 2010 - 04:55 PM

Hello Boki,

thanks for the offer. Much appreciated!

The thing is, we are pretty close releasing a new version of our product and I don't want to include an "untested" NextGrid release into the codebase that late. In respect to cell coloring. Have there been a lot of changes needed for that request in your code? If not, perhaps you can provide me with the necessary changes, so that I can incorporate the changes into my used 5.2.5 public release?

If this is too much work for you to provide me with the necessary changes, I can wait for the next release. No problem!

Thanks,
Thomas
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and NexusDB V2
Upscene Productions: http://www.upscene.com
My blog: http://blog.upscene.com/thomas/

#13 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 29 November 2010 - 12:55 AM

Hello Thomas,

I will send you PM

Best regards
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.

#14 Thomas Steinmaurer

Thomas Steinmaurer
  • Members
  • 131 posts

Posted 29 November 2010 - 10:43 AM

Hello Boki,

cause the RowVisible property wasn't in your grid implementation available, I simply merged your TextColor changes into my V5.2.5 release and this works like a charm!

Thanks a lot!!!

Thomas
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and NexusDB V2
Upscene Productions: http://www.upscene.com
My blog: http://blog.upscene.com/thomas/

#15 scrat1979

scrat1979
  • Members
  • 2 posts

Posted 16 October 2011 - 12:43 AM

Hello Boki!

I also appreciate this coloring-feature without events. Unfortunately I can't find the "Grid.Cell[x,y].Textcolor" - property in the current version of the NextSuite. Where can I find the property? Thank you in advance...

Michael

#16 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 16 October 2011 - 02:25 AM

Hi Michael,

TextColor is here for several releases. Maybe you are using some older version which don't have this property included.

I recommend downloading latest release.
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.

#17 scrat1979

scrat1979
  • Members
  • 2 posts

Posted 16 October 2011 - 10:51 AM

I'am sorry! Although I am sure that I downloaded the current version it seems to be an older one. Now I downloaded it again and the property is there! Thank you very much!

Michael

#18 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 16 October 2011 - 08:02 PM

No problem ;)
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.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users