Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: XE7 FMX on PC: how to set the StringGrid background color?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 5 - Last Post: Mar 17, 2015 8:15 AM Last Post By: Borja Serrano
hots wally

Posts: 53
Registered: 6/14/14
XE7 FMX on PC: how to set the StringGrid background color?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 11, 2015 6:36 AM
XE7 FMX on PC: how to set the StringGrid background color or cell color ? thanks a lot!
till now , I can't find a example
Borja Serrano

Posts: 172
Registered: 1/10/13
Re: XE7 FMX on PC: how to set the StringGrid background color?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 11, 2015 7:05 AM   in response to: hots wally in response to: hots wally
You can use:

http://docwiki.embarcadero.com/Libraries/XE6/en/FMX.Grid.TCustomGrid.OnDrawColumnCell

You have a sample here: http://stackoverflow.com/questions/12889428/coloring-cell-background-on-firemonkey-stringgrid-according-to-value-from-data

hots wally wrote:
XE7 FMX on PC: how to set the StringGrid background color or cell color ? thanks a lot!
till now , I can't find a example
hots wally

Posts: 53
Registered: 6/14/14
Re: XE7 FMX on PC: how to set the StringGrid background color?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 16, 2015 7:40 PM   in response to: Borja Serrano in response to: Borja Serrano
Borja Serrano wrote:
You can use:

http://docwiki.embarcadero.com/Libraries/XE6/en/FMX.Grid.TCustomGrid.OnDrawColumnCell

You have a sample here: http://stackoverflow.com/questions/12889428/coloring-cell-background-on-firemonkey-stringgrid-according-to-value-from-data

hots wally wrote:
XE7 FMX on PC: how to set the StringGrid background color or cell color ? thanks a lot!
till now , I can't find a example

Very Good!

THE cell color can be set now, but if I want to set the row color(not a cell color) how can I get? thanks a lot!
Borja Serrano

Posts: 172
Registered: 1/10/13
Re: XE7 FMX on PC: how to set the StringGrid background color?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 17, 2015 7:39 AM   in response to: hots wally in response to: hots wally
Hello,

THE cell color can be set now, but if I want to set the row color(not a cell color) how can I get? thanks a lot!

Just use that event in all the cells of your row. It is one of the parameters of the event function

If Row=3 //for instance...
Delphi Developer

Posts: 37
Registered: 1/11/13
Re: XE7 FMX on PC: how to set the StringGrid background color?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 17, 2015 7:47 AM   in response to: Borja Serrano in response to: Borja Serrano
If we need to change the particular cell font color, then what we should need to do.?

Edited by: Delphi Developer on Mar 17, 2015 7:47 AM
Borja Serrano

Posts: 172
Registered: 1/10/13
Re: XE7 FMX on PC: how to set the StringGrid background color?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 17, 2015 8:15 AM   in response to: Delphi Developer in response to: Delphi Developer
The same event will work. Just set DefaultDrawing to false and draw all the content of the cell (FillText to write)

http://docwiki.embarcadero.com/Libraries/XE6/en/FMX.Grid.TCustomGrid.OnDrawColumnCell

Take a look at the TGrid code. That will definitively help you.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02