I have a custom ad-hoc datasource that returns a GQIDateTimeColumn. We are only providing the value if the DateTime is applicable, if it's not, we are providing "N/A" as DisplayValue.
How can this DisplayValue be used in a table component? Currently, the cell is empty when no value is provided.
DisplayValue overrides the Value, but you must still provide a valid Value even if you don't intend to display it.
This works:
source.EventTime.HasValue
? new GQICell { Value = source.EventTime.Value.UtcDateTime }
: new GQICell { Value = default(DateTime).ToUniversalTime(), DisplayValue = "N/A" },
source.ActualStartTime.HasValue
? new GQICell { Value = source.ActualStartTime.Value.UtcDateTime }
: new GQICell { Value = default(DateTime).ToUniversalTime(), DisplayValue = "N/A"},
Kind regards,
Tom
There is a bug where the DisplayValue of empty cells will be ignored if the cell Value is null. This will be fixed asap.
As you show, the workaround is indeed to use any value other than null to represent an empty/missing/unknown/undefined cell.