Solved

Dynamically Changing the Visibility of Columns of TListView

Posted on 2001-08-06
3
227 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
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

808 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