Lost of column data with use of DataModule

TeeGrid VCL / FMX for Embarcadero RAD Studio, Delphi, C++ Builder and Lazarus Free Pascal.
Post Reply
bflorac
Newbie
Newbie
Posts: 1
Joined: Mon Jan 30, 2023 12:00 am

Lost of column data with use of DataModule

Post by bflorac » Tue Jan 31, 2023 5:37 am

If the DataSource is located in a TDataModule, when the application is run, all the column data (header text, width) is cleared and reinitiated from the database.

I also tried putting DataSource is on the same form as the Grid but the data components that are referenced in a TDataModule, but this causes it to crash.

I assumed is because the TDataModule has not been created when the grid is so it defaults to nil and clears out the columns so I changed the project so the TDataModule is created before the main form. This seems to work but I wonder what other ramifications it may have as I have never done this before.

Is there any way to persist the column data thru or after a change/assignment of the dataSource short of me hand coding them after the application starts?

Post Reply