NULL time in TwwGridColumn is displayed as 0:00
I've got a SQLite database with a column which contains time values (no date!). Because SQLite does not have special date-time-data types, the data type of the row is REAL. The values are in the range from 0.0 (0:00:00) up to 0.9999... (23:59:59), or NULL for "no time".
To display the time column in a TwwDataGrid, I use a TwwGridColumn with ControlType = gdctDateTime and ControlAttributes.DateTime.DataType = wwDTEdtTime. The problem is, that NULL values are displayed as "0:00" instead of showing a blank cell.
On the contrary, colums with a date value and ControlAttributes.DateTime.DataType set to wwDTEdtDate are working fine with NULL values.
Additional information:
- The DataSource is bound with a TBindSourceDB to a TFDQuery.
- I can guarantee that the NULL values are really NULL, not just empty strings or zero.
- I have NOT tested with an other database type (Interbase, FireBird, ...), so I don't know if the problem only occures when the database time field is a floating point type instead of a "real" date-time-type.
-
I have run into various problems with displaying things in grids, from it showing "(memo)" instead of the beginning of a string, to things such as you described.
In recent FMX apps that use SQLite, I remember having to do some kind of casting in the queries to get around such problems but I will have to dig around for that and I hope to post a follow-up message here in the next day or two. I will also look to see if I specify anything special for those columns in the grids.
Please sign in to leave a comment.
Comments
1 comment