Solved

CListView Problem

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Turn a spreadsheet into a vba executable. 2 66
format the code in java 6 72
sum13 challenge 24 77
Line meaning 9 77
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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…
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now