Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CListView Problem

Posted on 1999-01-26
4
Medium Priority
?
212 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 100 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

618 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