delphi - How to make grid refresh on horizontal scroll -


after hours, i've been unable find reference issue, here or elsewhere. problem shows multi-device applications (hence fmx not vcl), both android , windows (i cannot know ios).

the setup : place grid (tgrid or tstringgrid) on form. make grid larger form adding columns, ensuring horizontal scrolling needed. in grid options, choose draw collines, rowlines , alternatingrowbackground. rowselect can true, highlight entire row @ once.

the problem : when scrolling horizontally, hidden part of grid not show rowlines or background (collines drawn), or highlight rowselect. coloring , drawing cut regardless of column limits. when resizing window fit grid (on windows os), colors , lines drawn on hidden columns.

i've tried, both ondrawcolumncell , onhscrollchange events :

  • stringgrid.repaint, self.invalidate : no result
  • application.handlemessage, application.processmessages : slow down app
  • stringgrid.canvas.clear(0) : slow down , mess app
  • change between debug , release versions : no result
  • change grid.align client, none, fit, contents, scale : no result

please, know way make grid display expected when scrolled horizontally ?


edit 12-aug-2016 : delphi 10.1 (berlin) not concerned

ok found it. @ last.

for highlighting spread on entire row when selecting (even hidden part), 1 have play styles.

i didn't go deep inside style editing here's @ :

  • with grid component (tgrid, tstringgrid) on form, right-click grid , choose edit default style or edit custom style open firemonkey style designer window (see docwiki details)
  • in structure view go : gridstyle > background > content > selection
  • in object inspector, align property selection none default : that's why highlighting won't spread on entire row !
  • change value horizontal , you're done. other values not trick. (contents, client : entire grid highlighted) (fit, center : highlighting centered on grid)

surprisingly, in delphi 10.1, default configuration same selection correctly spread on entire row if needed...

note : gridstyle tlayout ; background trectangle ; content tlayout ; selection trectangle


Comments