RE: Add Today's Date in DateEdit Control
Grids are bound to a datasouce, therefore you need to initialize the table buffer and not the control itself. When you open the form, you have three options what may happen:
- The grid already contains records. In this case, existing records have their own value of the field saved in database; you won't initialize anything when opening the form. You'll initialize the field to the current date only when you create a new record (such as by pressing Ctrl+N).
- If the grid is empty and the datasource isn't configured to create a new record if empty, it's similar to previous case. There is nothing to initialize unless you create a new record.
- If the grid is empty and the datasource is configured to create a new record if empty, opening the form will automatically create a new record and that's when you wan to initialize it.
As you see, it's not really opening the form; it's about creating a new record in the datasource.
You can put such initializing logic into initValue() method. If records should always be initialized in this way, use initValue() on the table. If it's logic specific to this one form only (and shouldn't be used when new records are created in other forms), use initValue() on the datasource.
systemDateGet() will give you the current date.