Solved

Display column in ClistCtrl?

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
iSeries FTP Exit Program 8 135
Hibernate methods 2 71
Making an alias 7 93
Problem to App 4 79
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

785 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