Solved

Dynamically Changing the Visibility of Columns of TListView

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

813 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

17 Experts available now in Live!

Get 1:1 Help Now