How do I set the database control properties once they are created in the layout?
I override a AdvDBEdit and make it a dcDate. The date format I want to use is yyyy-mm-dd, which is how it is stored in the database. I have set the default format in the OnCreate event of the form:
System.SysUtils.FormatSettings.ShortDateFormat := 'yyyy-mm-dd';
System.SysUtils.FormatSettings.LongDateFormat := 'yyyy-mm-dd';
But the dcDate complains that the date it reads in is an invalid format, and also includes a time section (I only want the date).
Thanks for any insight.
The event OnControlCreated is triggered after every control is created and reference is passed via AControl parameter. You can in the case of TDBAdvEdit cast AControl to TDBAdvEdit and customize it from this event.