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

x
?
Solved

Dynamically Changing the Visibility of Columns of TListView

Posted on 2001-08-06
3
Medium Priority
?
233 Views
Last Modified: 2010-04-06
As I can tell, there is no Visibility property of the TListView Columns (TListColumn).

I need to add the option for configuring the TListview to allow the end user to check which columns they want visible.

How do I implement this feature.

Do I have to clear and recreate the columns each time, and then refill the items?

What I currently do is each time the end user checks on or off a column in the configuration dialog, I clear the list columns create them according to what they checked, and then refill the TListItems.

There has got to be a better way.

Shane
0
Comment
Question by:shaneholmes
[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
3 Comments
 

Expert Comment

by:comptebidon81
ID: 6355873
Do you give the user the possibility to modify the column width? If not, you could set your column's width to zero. I know this is not a pretty way to do things, but you would save a lot of code.

GunDamn
0
 
LVL 11

Author Comment

by:shaneholmes
ID: 6355887
Well, I kind of played with changing the width to zero, but I allow the user to drag the columns to the width of their choice, which makes for better viewing of some very large columns of strings.

When setting a columns width to zero and then attempting to drag the column before that column, your making that column with the width = 0 visible again.

Shane
0
 
LVL 4

Accepted Solution

by:
fva earned 75 total points
ID: 6356090
As I looked in Win' API for the list view control (merely shelled only by TListView), I think there's no easy way to do that. The only improvement would be that you can selectively delete/insert a column using Win API, but you will still have to update accordingly the subitems for each item in the list. Please note that the Columns property does not support Insert or equivalent command, and that this might still cause problems.

F.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

688 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