It appears that when creating a new form that contains a TDBAdvGrid, the OnSelectCell event is triggered before all controls on the form have been created. I use a timer to load details of a selected row, and I restart the timer on this event. On form creation, and before the FormCreate event occurs, my timer is nil, i.e. has not yet been created, and it causes an access violation depending on the control creation order (I have one form where the timer was created before the grid, but another where it is created after the grid).
The Grid is not connected to a dataset at this time, so why is it triggering this event? I had to add a form level boolean fControlsCreated which is set to true on FormCreate in order to exit the OnSelectCell immediately if fControlsCreated is false.
Delphi Rio 10.3.1
Clarification. The Grid is connected to a DataSource and the DataSource is connected to a ClientDataSet, but the client dataset is not active.