Solved

Display column in ClistCtrl?

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Turn a spreadsheet into a vba executable. 2 103
difference between String.subString() and String.subSequence() 6 290
ShiftLeft challenge 21 95
changeXy challenge 13 98
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.

751 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