diff --git a/include/wx/generic/dataview.h b/include/wx/generic/dataview.h index 8296c5eef8..de5b225581 100644 --- a/include/wx/generic/dataview.h +++ b/include/wx/generic/dataview.h @@ -389,8 +389,6 @@ class WXDLLIMPEXP_ADV wxDataViewCtrl: public wxDataViewCtrlBase, public: wxDataViewCtrl() : wxScrollHelperNative(this) { - //No sorting column at start, I think - m_sortingColumn = NULL; Init(); } @@ -400,7 +398,6 @@ public: const wxValidator& validator = wxDefaultValidator ) : wxScrollHelperNative(this) { - m_sortingColumn = NULL; Create(parent, id, pos, size, style, validator ); } diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 794a94a966..fb301b760d 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -4093,6 +4093,10 @@ void wxDataViewCtrl::Init() { m_cols.DeleteContents(true); m_notifier = NULL; + + // No sorting column at start + m_sortingColumn = NULL; + m_headerArea = NULL; } bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, @@ -4102,14 +4106,14 @@ bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, if ( (style & wxBORDER_MASK) == 0) style |= wxBORDER_SUNKEN; + Init(); + if (!wxControl::Create( parent, id, pos, size, style | wxScrolledWindowStyle, validator)) return false; SetInitialSize(size); - Init(); - #ifdef __WXMAC__ MacSetClipChildren( true ); #endif