diff --git a/include/wx/dataview.h b/include/wx/dataview.h index 298ab7f979..2aa4a60d7d 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -972,6 +972,7 @@ public: void InsertItem( unsigned int row, const wxVector &values, wxUIntPtr data = 0 ); void DeleteItem( unsigned int pos ); void DeleteAllItems(); + void ClearColumns(); unsigned int GetItemCount() const; @@ -1040,6 +1041,7 @@ public: virtual bool PrependColumn( wxDataViewColumn *col ); virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col ); virtual bool AppendColumn( wxDataViewColumn *col ); + virtual bool ClearColumns(); wxDataViewColumn *AppendTextColumn( const wxString &label, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index f10f465ca2..fd7412117a 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -1790,6 +1790,11 @@ void wxDataViewListStore::DeleteAllItems() Reset( 0 ); } +void wxDataViewListStore::ClearColumns() +{ + m_cols.clear(); +} + void wxDataViewListStore::SetItemData( const wxDataViewItem& item, wxUIntPtr data ) { wxDataViewListStoreLine* line = m_data[GetRow(item)]; @@ -1893,6 +1898,12 @@ bool wxDataViewListCtrl::AppendColumn( wxDataViewColumn *col ) return AppendColumn( col, "string" ); } +bool wxDataViewListCtrl::ClearColumns() +{ + GetStore()->ClearColumns(); + return wxDataViewCtrl::ClearColumns(); +} + wxDataViewColumn *wxDataViewListCtrl::AppendTextColumn( const wxString &label, wxDataViewCellMode mode, int width, wxAlignment align, int flags ) {