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?

Marc
Site Admin
Site Admin
Posts: 1203
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Lost of column data with use of DataModule

Post by Marc » Wed Apr 05, 2023 9:54 am

Thanks for the feedback.

You seem to have found the solution for the particular case you have in-hand. I've looked at a few of the examples included with TeeGrid, such as the Datasource example here:
https://github.com/Steema/TeeGrid-VCL-F ... DataSource

The behaviour is different, designtime changes to the header are saved for the runtime display but perhaps I need to run a different configuration to see the issue. Are you able to reproduce the problem on any of the public examples or perhaps you have an example or steps-to reproduce that you can send us?

With thanks.
Regards,
Marc Meumann
Steema Support

Post Reply