Solved

CListView Problem

Posted on 1999-01-26
4
201 Views
Last Modified: 2013-11-20
I am trying to use a list view in report style but I cannot get any text to appear under any of my columns?  I know the list control is populated with items ( I've checked the getItemText to be sure), but I can't seem to show the list in report form.  The view seems to know they are there( 'cause the scrollbars are defined)..  

All I am doing is Inserting columns by
cListView.InsertColum(nIndex,"Header",LVCFMT_TEXT,nWidth,0);

Then Inserting Item by
cListView.InsertItem(nIndex,text(nIndex));

All of this is done in the InitialUpdate Procedure...

What Am I missing?
0
Comment
Question by:gpaige
  • 2
  • 2
4 Comments
 
LVL 1

Expert Comment

by:atari
ID: 1328344
 // In OnInitialUpdate you must first get a pointer to the CListCtrl in the CListView:
  CListCtrl &m_listctrl=GetListCtrl();

  // Define some columns
  m_listctrl.InsertColumn(0,"1. column",LVCFMT_LEFT,400);
  m_listctrl.InsertColumn(1,"2. column",LVCFMT_LEFT,400);

Bye,
atari
0
 

Author Comment

by:gpaige
ID: 1328345
I have a reference to the listcontrol and my columns are defined... i can see the column headers....
I guess my label was bad -- cListView is defined as
CListCtrl& cListView = GetListCtrl();
0
 
LVL 1

Accepted Solution

by:
atari earned 50 total points
ID: 1328346
Haven't you looked at my above code exactly:

Try this:
m_listctrl.InsertColumn(0,"1. column",LVCFMT_LEFT,400);
m_listctrl.InsertColumn(1,"2. column",LVCFMT_LEFT,400);

Bye,
atari
0
 

Author Comment

by:gpaige
ID: 1328347
I figured it out -- I converted my standard view from the base of CView to CListView -- but neglected to change the base class in all instances - I only changed it in the class constructor
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
method notes when mouse over in eclipse 5 87
either24  challenge 19 101
fix34  challenge 9 141
Line meaning 9 87
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seveā€¦
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question