TMSFNCGRID

We are using cell-based color and horizontal alignment properties in the TMSFNCGRID object after establishing a database connection. However, when we use both cell-based color and horizontal alignment at the same time, the first property in the code works, but the next property changes when the cell is focused. What is your solution to this problem?

Example :

TMSFNCGrid1.Colors[3,3] := TAlphaColors.Darkblue;
TMSFNCGrid1.HorzAlignments[3, 3] := TTMSFNCGraphicsTextAlign.gtaCenter;

Set TMSFNCGrid1.UseColumns := False;

TMSFNCGrid1.UseColumns := False;
TMSFNCGrid1.HorzAlignments[3, 3] := TTMSFNCGraphicsTextAlign.gtaCenter;
TMSFNCGrid1.Colors[3, 3] := TAlphaColors.Darkblue;

I added 'TMSFNCGrid1.UseColumns := False;', but the issue still persists: it centers the cell content, but the color is only displayed when the cell is focused.

Please wrap the code with

  TMSFNCGrid1.BeginUpdate;
  TMSFNCGrid1.UseColumns := False;
  TMSFNCGrid1.HorzAlignments[3, 3] := TTMSFNCGraphicsTextAlign.gtaCenter;
  TMSFNCGrid1.Colors[3, 3] := TAlphaColors.Darkblue;
  TMSFNCGrid1.EndUpdate;

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.