Insert/delete wxDataViewColumn after performing reorder column in wxDataViewCtrl

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

Insert/delete wxDataViewColumn after performing reorder column in wxDataViewCtrl

Post by Anil8753 »

I did columns reordering in wxDataViewCtrl. I inserted a new column using InsertColumn() API.

I got the following assert failure:

Code: Select all

---------------------------
wxWidgets Debug Alert
---------------------------
..\..\src\msw\headerctrl.cpp(442): assert "order >= 0 && order <= GetShownColumnsCount()" failed in wxHeaderCtrl::MSWToNativeOrder(): logic error

Call stack:
[00] wxHeaderCtrl::DoInsertItem                 f:\cwscode\tools\source\wxwidgets-3.0\src\msw\headerctrl.cpp:347
[01] wxHeaderCtrl::DoSetCount                   f:\cwscode\tools\source\wxwidgets-3.0\src\msw\headerctrl.cpp:218
[02] wxHeaderCtrlBase::SetColumnCount           f:\cwscode\tools\source\wxwidgets-3.0\src\common\headerctrlcmn.cpp:108
[03] wxDataViewCtrl::OnColumnsCountChanged      f:\cwscode\tools\source\wxwidgets-3.0\src\generic\datavgen.cpp:4766
[04] wxDataViewCtrl::InsertColumn               f:\cwscode\tools\source\wxwidgets-3.0\src\generic\datavgen.cpp:4750

Do you want to stop the program?
You can also choose [Cancel] to suppress further warnings.
---------------------------
Yes   No   Cancel   
---------------------------

The same is true with DeleteColumn() API too, not working after reordering column.

What is this logic error and most important my all reordering changes back to original column orders. I want to allow the user to perform reorder/add/delete columns, but after reordering add/delete not working at all.

I feel this is a bug with wxDVC, same I can reproduce in wxWidgets dataview sample as well
Post Reply