Solved

Dynamically Changing the Visibility of Columns of TListView

Posted on 2001-08-06
3
229 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 25 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

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