diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index 770022875e..d9e3d93a69 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -813,12 +813,14 @@ wxDataViewRendererBase::PrepareForItem(const wxDataViewModel *model, const wxDataViewItem& item, unsigned column) { - // Now check if we have a value and remember it if we do. + // Now check if we have a value and remember it for rendering it later. + // Notice that we do it even if it's null, as the cell should be empty then + // and not show the last used value. const wxVariant& value = CheckedGetValue(model, item, column); + SetValue(value); + if ( !value.IsNull() ) { - SetValue(value); - // Also set up the attributes for this item if it's not empty. wxDataViewItemAttr attr; model->GetAttr(item, column, attr);