Solved

Display column in ClistCtrl?

Posted on 2001-07-02
4
332 Views
Last Modified: 2013-11-20
I have five columns in CListCtrl( report), but I only want to display 2 columns. How to do this?
Thanks
0
Comment
Question by:pbtdanh
  • 2
4 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 6244541
if u wanna get rid of the other columns use DeleteColumn() and then RedrawWindow() and if u wanna hide the columns, u need to save their content somewhere and rebuild the list control every time u wanna hide one of the columns.
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 25 total points
ID: 6244559
i suggest u to have an array of CArray:
CArray<CString, CString> m_array[5];
//for each one of the columns

and also an array of boolean:
m_bAttribute[5]; //hide or show columns

when ever there is a change in one of the columns attributes call a function which would delete all items and columns of the list control and then create only the columns which are should be display,

for(int i=0; i<5; i++)
{
if(m_bAttribute[i] == true)
   //insert column and items
else
   continue;
}

good luck
0
 
LVL 2

Assisted Solution

by:MadYugoslav
MadYugoslav earned 25 total points
ID: 6247552
If You need to have that columns (not to be deleted) do next:
- Disable resizing columns.
- Set column width (that You don't want to see) to zero.
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9490147
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by : sedgwick, MadYugoslav (points to be split)

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Roshan Davis
EE Cleanup Volunteer
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

705 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

21 Experts available now in Live!

Get 1:1 Help Now