Re: CListView not inserting items
On 16 Sep 2006 08:07:17 -0700, "MK" <michaelkatsilis@yahoo.com> wrote
in <1158419237.311716.252970@b28g2000cwb.googlegroups.com>:
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;
LVS_REPORT would control whether the header was visible, yes.
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)?
That's a good question. I would think yes, but I haven't actually
tested it. Using the InsertColumn() function would certainly be
safer.
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.
That's odd.
I noticed something else:
On 10 Sep 2006 18:14:04 -0700, "MK" <michaelkatsilis@yahoo.com> wrote
in <1157937243.893810.81420@e3g2000cwe.googlegroups.com>:
BOOL CefsmView::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style |= LVS_SHOWSELALWAYS | LVS_REPORT;
return CListView::PreCreateWindow(cs);
}
void CefsmView::OnInitialUpdate()
{
CListView::OnInitialUpdate();
LONG dwStyle;
dwStyle = WS_TABSTOP |
WS_CHILD |
LVS_AUTOARRANGE |
LVS_REPORT |
LVS_EDITLABELS |
LVS_SHAREIMAGELISTS |
WS_VISIBLE;
mobjListCtrl.ModifyStyle(mobjListCtrl.GetStyle(), dwStyle);
}
Some styles cannot be set postcreation, so I would move all of those
into PreCreationWindow().
On 16 Sep 2006 08:07:17 -0700, "MK" <michaelkatsilis@yahoo.com> wrote
in <1158419237.311716.252970@b28g2000cwb.googlegroups.com>:
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.
Do the columns change based on the item in the treeview? If not, then
don't delete them.
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.
Sorry, but that's a little unclear. Are you saying that text appears
in column 0, but in no other columns, even though you have more than
one? Also, are you saying that inserting the columns in OnCreate()
does not result in any visible columns? If so, I would definitely try
with InsertColumn() instead and see if that makes a difference.
--
Charles Calvert | Software Design/Development
Celtic Wolf, Inc. | Project Management
http://www.celticwolf.com/ | Technical Writing
(703) 580-0210 | Research