Jump to content


Photo

How to change inactive grid cell font color?


  • Please log in to reply
2 replies to this topic

#1 tonyamosza

tonyamosza
  • Members
  • 3 posts

Posted 22 October 2014 - 08:05 PM

Please help me with this.

I've found the property InactiveSelectionColor, but I'm looking for a property (or workaround) that also changes the font color of cells when the grid is inactive (not focused). At the moment, the font is always black.

Thank you, any assistance would be appreciated.

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 23 October 2014 - 06:53 AM

Hi,

I suggest that you try OnCellFormatting event for this. It seems that I have not think about this property. I will see about to adding it.
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 tonyamosza

tonyamosza
  • Members
  • 3 posts

Posted 23 October 2014 - 08:14 AM

Thank you!

I added this code and it works exactly the way I want it to.


procedure TfrmBilling.grdTxCellFormating(Sender: TObject; ACol, ARow: Integer;
var TextColor: TColor; var FontStyle: TFontStyles; CellState: TCellState);
begin
if csSelected in CellState then
begin
TextColor := clWhite;
end;
end;




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users