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