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?
Lost of column data with use of DataModule
Re: Lost of column data with use of DataModule
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
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