TTMSFMXGrid - alignment issue with AdaptToStyle

Horizontal alignment commands such as


TMSFMXGrid1.Columns[0].HorzAlignment:=TTExtAlign.Center

have no effect on alignment after setting AdaptToStyle to True. Presumably, the style is overriding the setting. How might this be overcome?

I am using the styles from Embarcadero's Firemonkey Premium Styles Pack.

Hi, 


You cannot combine the column appearance settings with adapt to style. When AdaptToStyle is set to false you need to use the HorzAlignment properties directly, instead of the ones on column level.

  TMSFMXGrid1.HorzAlignments[1, 1] := TTextAlign.Center;

Kind Regards, 
Pieter
 

Thanks for response. Did you mean "When AdaptToStyle is set to true..."? Unfortunately, AdaptToStyle = true seems to prevent the desired alignment whether or not the command is given at the column or cell level.

My apologies, When AdaptToStyle is set to true, you should be able to use the HorzAlignments properties. These properties are per cell, not per column.


Kind Regards, 
Pieter

Please ignore the second part of my last post. Your suggestion DOES work.  The alignment can indeed be set at the cell level when AdaptToStyle is true. Thank you for your help.