With TMSFNCGrid the GetCellData event is called as part of the Form.Create sequence, but for the TMSFMXGrid it is called as part of the Form.Show sequence. Having it as part of the Form.Create sequence is very problematic and seems wrong given that the form is not yet visible. Is this an intentional difference or one that you can change?
Why is this sequence problematic? It is by design that the grid data is retrieved during the creation process. The reason why the OnGetCellData is called during the form show sequence is because the TMS FMX Grid style was not loaded yet. You can easily change this by force loading the style in the constructor. If this was done, the behaviour is identical to that of TMS FNC Grid. TMS FNC Grid is not working with an internal style and therefore is loading the data as soon as the grid is created. In which situation are you experiencing difficulties with this?
Thanks for explaining the styles background to this.
I have two problems with the behaviour:
The first is that if you have a form OnCreate event that sets important variables used by the GetCellData event then this now breaks as the GetCellData is called before the OnCreate event.
The second is that I often manually create a form and then send it data with an overridden show event.
I can work around this with tests in the GetCellData event to see if the form has data.