Solved

Dynamically Changing the Visibility of Columns of TListView

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

705 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now