Solved

CListView Problem

Posted on 1999-01-26
4
198 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CRON statement to run every 3 minutes except on Monday morning 12am to 2am 7 94
maxBlock challenge 30 129
centeredAverage challenge 8 165
mapAB Challlenge 35 145
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

777 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