Link to home
Start Free TrialLog in
Avatar of swestbrook60
swestbrook60

asked on

Text alignment in Delphi XE3 TStringGrid when style is gdsThemed.

Cam someone guide me on how to set the text in a TStringGrid cell to be center aligned instead of the default left aligned using Delphi XE3? The typical OnDrawCell routines do not work when the DrawingStyle is set to gdsThemed, but they do work with this property set to gdsClassic or gdsGradient.  With this DrawingStyle setting and DefaultDrawing property set to True, you get the text in both locations, left and center aligned because the default drawing routines for the themed style have already run before your custom OnDrawCell event is executed. If you turn the DefaultDrawing property to Falsae, you lose all of the themed cell drawing which defeats the use of gdsThemed as your style.
ASKER CERTIFIED SOLUTION
Avatar of developmentguru
developmentguru
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aikimark
Is there a Firemonkey alternative to the TStringGrid control?
There is a Grid control but I am not sure I would consider it an alternative except for the fact that both are grids... they are wildly different components.
Avatar of swestbrook60
swestbrook60

ASKER

Seems like a great deal of work for the end result but thanks for letting me realize the task at hand to acheive this. No wonder most people resist using the themed settings in these components except where absolutely required.