wxDataViewCtrl rearrange columns programmatically

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Anil8753
Experienced Solver
Experienced Solver
Posts: 93
Joined: Sat Jan 16, 2016 5:57 am
Location: India

wxDataViewCtrl rearrange columns programmatically

Post by Anil8753 »

Hi,
We can rearrange the columns by dragging and dropping to the desired position.
Same thing I need to achieve via source code. Like : wxDataViewCtrl::Move(const wxDataViewColumn* pColumn, int pos)

I am using generic wxDataViewCtrl.
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxDataViewCtrl rearrange columns programmatically

Post by doublemax »

I think it's not possible with the current API. Unfortunately there is no getter for the private member "wxDataViewHeaderWindow *m_headerArea;". You'd have to derive your own class from wxDataViewCtrl , then you could use wxHeaderCtrl::SetColumnsOrder(). (wxDataViewHeaderWindow derives from wxHeaderCtrl )

http://docs.wxwidgets.org/trunk/classwx ... b0df0b8990
Use the source, Luke!
Post Reply