Re: CListView not inserting items
Hi Charles,
Thanks for your response, I appreciate it. I think I used the header
control because the header row wasn't visible either. But that could
have been due to not setting
cs.style |= LVS_SHOWSELALWAYS | LVS_REPORT;
and once I got the header control working, I didn't bother with the
columns. Am I correct in assuming that you're implying that the code
that inserts via the header control is actually creating columns (this
is something I wanted to confirm)? I'll try inserting columns again and
see how I go.
I also ran the code with the call to the Reset() method commented out,
but that didn't make a difference. The idea of the Reset() method is to
refresh the list with completely new entries similar to Windows
Explorer does. So, when an item in the tree control is clicked, a list
of items are populated in the list control.
So, going back to the columns. In the existing code, if I insert a new
column before I populate (Insert & SetItemText) the existing columns in
the Populate() method, then it actually inserts an item in that column
but no sub items.
Charles Calvert wrote:
On 10 Sep 2006 18:14:04 -0700, "MK" <michaelkatsilis@yahoo.com> wrote
in <1157937243.893810.81420@e3g2000cwe.googlegroups.com>:
I
cannot get the list view to show any values other than the column
headings.
[snip]
int CefsmView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CListView::OnCreate(lpCreateStruct) == -1)
return -1;
// Setup the columns
CHeaderCtrl * hc = mobjListCtrl.GetHeaderCtrl();
This isn't related, but why are you getting the header control instead
of just using CListCtrl::InsertColumn()?
void CefsmView::Populate(const CString & sItemName)
{
// sItemName is being passed into the method ok
Reset();
You just deleted all of the columns that you so carefully inserted via
Cefsm::OnCreate(). If you have no columns, no items will be
displayed. Check your Reset function:
[snip]
void CefsmView::Reset(void)
{
mobjListCtrl.DeleteAllItems();
while(objListCtrl.DeleteColumn(0));
UpdateWindow();
}
Why are you deleting the columns?
--
Charles Calvert | Software Design/Development
Celtic Wolf, Inc. | Project Management
http://www.celticwolf.com/ | Technical Writing
(703) 580-0210 | Research