I have a couple of cards with datagrids on them to show data from a SQLite table in my application. They work great. However ...
When I run the app on my Android device the header text for the datagrid columns are empty. The header IS shown, but without the columns labels. They show as they should on Mac and Win. So I'm stumped as to why they are missing on Android.
In an earlier version of my app I know that the column headers WERE showing, but now they are not. So I re-created the DGs but that did not fix it.
Can anyone give me an idea of how to fix this?
TIA.
Disappearing datagrid headers
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Disappearing datagrid headers
I figured it out.
After reading this on the LiveCode Lessons about DataGrids ...
"Don't try to draw a Data Grid on a card that Is not open
When a Data Grid renders it dynamically creates fields and accesses certain properties. Some of these properties can not be properly reported by the Revolution engine unless the field is on an open card."
... I realized that I had changed the way I was sizing controls to fit the screen size. I was sending a message to the card without being on the card, which handler included resizing and setting some properties of the DataGrid control. So I modified my code to move to the card before resizing and placing the controls.
After doing that, the header text appeared as it should.
After reading this on the LiveCode Lessons about DataGrids ...
"Don't try to draw a Data Grid on a card that Is not open
When a Data Grid renders it dynamically creates fields and accesses certain properties. Some of these properties can not be properly reported by the Revolution engine unless the field is on an open card."
... I realized that I had changed the way I was sizing controls to fit the screen size. I was sending a message to the card without being on the card, which handler included resizing and setting some properties of the DataGrid control. So I modified my code to move to the card before resizing and placing the controls.
After doing that, the header text appeared as it should.
Leston