Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Display column in ClistCtrl?

Posted on 2001-07-02
4
Medium Priority
?
375 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 100 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 100 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

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…
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 …
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

730 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