How to best set dataset fields to non null value
<p>I have a client dataset where fields are updated
when messages come in from external communication channels.
Not all fields are updated by every message.</p>

<p>The dataset is displayed by a dbgrid.
Some fields are displayed using OnDrawColumnCell events.</p>

<p>During the startup phase, before recirds exist,
messages can be received in any order.
After each post,
the OnDrawColumnCell event is generated,
BUT not all fields have been written yet, and are null.</p>

<p>The null fields cause exceptions when OnDrawColumCell wants to use them.
I need to make sure all fields are always non null,
for instance by filling all with default values when creating the record.</p>

<p>Finally to my question(s).</p>

<p>Q1: Is defaulting all fields on record creation the best way?
    It requires maintenance discipline when things change.</p>

<p>Q2: Is try/except a good way to catch this in the event?
    It too requires discipline, to catch all.</p>

<p>Q3: Is there a better way to avoid this issue?</p>

<p>Q4: Am I not thinking properly?</p>

<p>Thanks for any suggestions,</p>

<p>Anders Johansson</p>