Delphi XE4 Firemonkey Grid Control - Styling cells individually -


we have upgraded delphi 2010 xe4 , using firemonkey first time, stumbling in dark bit trying figure out how works.

as per query while i'm trying individual cells in tgrid component display differently based on rule. have worked through helpful code posted mike sutton:

firemonkey grid control - styling cell based on value (via ongetvalue function call)

i had make few changes compile in xe4; looks ok when running code, except that:

  1. fontfill not recognized, have blanked out now.
  2. the font style not changing @ all, displays default style, no matter what.

the relevant code (the rest pretty per link above):

procedure tfinancialcell.applystyle; var    t: tfmxobject; begin   inherited;   applystyling; end;  procedure tfinancialcell.applystyling; begin //  if isnegative //    fontfill.color:=clared //  else //    fontfill.color:=clablack;    font.style:=[tfontstyle.fsitalic];    if isimportant     font.style:=[tfontstyle.fsbold]   else     font.style:=[];    if assigned(font.onchanged)     font.onchanged(font);    repaint; end; 

the isimportant flags being set correctly doesn't seem problem.

any appreciated. apologies in advance stupid might missing.

that article has largely been superseded stuff in firemonkey guide site, http://monkeystyler.com/guide/category:grids

from xe3 onwards if want modify stuff need remove appropriate item styledsettings property,

styledsettings := styledsettings - [tstyledsetting.ssstyle, tstyledsetting.ssfontcolor] 

etc.

to change font color use fontcolor property


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -