Solved

Display column in ClistCtrl?

Posted on 2001-07-02
4
371 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
[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
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

Database Solutions Engineer FAQs

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller single-server environments.

Question has a verified solution.

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

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: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

628 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