Page 1 of 1

Lost of column data with use of DataModule

Posted: Tue Jan 31, 2023 5:37 am
by 18695213
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?

Re: Lost of column data with use of DataModule

Posted: Wed Apr 05, 2023 9:54 am
by Marc
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