Dafarkias here. Back with more questions
For the life of me, I can't figure out how to append/insert a column into my wxDataViewListCtrl after I've initially populated it with items. I spent all last evening messing with this, and now am still stuck this morning, unfortunately
My project is getting fairly sizeable so I will try and piece together the code bits I am attempting to use, to assist with any potential helpful diagnostics.
First I create my wxDataViewListCtrl.
Code: Select all
g_list = new MyDataView(w_panelTop); g_list->SetSize(0, 0, w(), 200);
Code: Select all
g_list->AppendTextColumn(temper2[i].substr(0, tEnd), wxDATAVIEW_CELL_INERT, -1, wxALIGN_CENTER, wxDATAVIEW_COL_RESIZABLE | wxDATAVIEW_COL_SORTABLE | wxDATAVIEW_COL_REORDERABLE);
...
data.push_back(wxString::Format(st2wx(items[b])));
glist->AppendItem(data, NULL);
When I go to insert or append a new column, I run into issues:
I have tried to add new columns many different ways, but my latest attempt I use a code snippet I pulled straight from the docs:
Code: Select all
wxVector<wxVariant> data;
g_list->AppendTextColumn("New Column");
data.push_back(wxVariant("row 1"));
g_list->AppendItem(data); // this line of code is performed in a "for" loop, equal to the number of columns
data.clear();
[edit]
I'd like to clarify from the error code that I am 99% positive that the issue is not my attempting to input an incorrect number of data indexes when using AppendItem. I have verified that the number of data indexes match the number of columns when debugging, and I'm using the same code I use to initially populate the table, which works just fine