This will not work in the dbgrid runtime ... See This (from the Delphi Language Guide on BDS 2006):
Property values ββare not automatically initialized to the default value. That is, the default directive only controls when property values ββare stored in the form file, but not the initial property value in the newly created instance.
For components in the form during development, I think there are no problems. But during the execution of the created controls, I think it is better (I mean, safer) to make an override on the constructor:
constructor Create(Aowner:TComponent); begin inherited; Options := [dgTitles, dgTabs, dgRowSelect, dgAlwaysShowSelection, dgCancelOnExit]; end;
To keep everything in order, also follow the default directive:
property Options default [dgTitles, dgTabs, dgRowSelect, dgAlwaysShowSelection, dgCancelOnExit];
source share