Here's what I'm doing so far:
Code: Select all
wxDataViewListCtrl* m_ctrl = new wxDataViewListCtrl( this, wxID_ANY ); m_ctrl->AppendToggleColumn( wxT("Toggle") ); m_ctrl->AppendTextColumn( wxT("Text") ); wxVector<wxVariant> data; data.push_back(false); data.push_back(wxT("test")); m_ctrl->AppendItem(data); m_ctrl->AppendItem(data); m_ctrl->Enable(); mysizer->Add( m_ctrl, 1, wxALL|wxEXPAND, 5 );
When I run the program everything displays okay, but nothing is editable. I can't check/uncheck the toggle columns, I can't click on the column headers (as if to sort by column). I can't even resize the colummns.
It's as if the control is disabled, but I'm explicitly enabling it!
I'm completely baffled. Am I missing a step?
I'm using MSVC++ 2010 Express on Windows Vista, but the compiler can't be the problem because the samples all compile and run fine.
EDIT: wxWidgets version 2.9.1
Any help appreciated!
As long as I'm posting, I could use some guidance here, as well.
My ultimate goal is to have the following:
- a list-like table
- sortable by individual columns
- text and date columns
- all fields editable "in place" (without a new window popping up)
wxDataViewListCtrl seems to be close, but doesn't seem to allow dates. So would I have to use a wxDataViewCtrl? Do I need to derive my own class from wxDataViewModel? Is there any tutorial on how to do that (the docs and samples are all extremely vague on the whole process)?
Thanks again! Any and all input is appreciated.
YET ANOTHER EDIT: ugh. I had the wrong parent. It seems to be fixed now.