- // do reorder the columns
- DoMoveCol(m_colBeingReordered, pos);
+ wxHeaderCtrlEvent event(wxEVT_COMMAND_HEADER_END_REORDER, GetId());
+ event.SetEventObject(this);
+ event.SetColumn(colOld);
+
+ const unsigned pos = GetColumnPos(FindColumnAtPoint(xPhysical));
+ event.SetNewOrder(pos);
+
+ if ( !GetEventHandler()->ProcessEvent(event) || event.IsAllowed() )
+ {
+ // do reorder the columns
+ DoMoveCol(colOld, pos);
+ }