Solved

List view column auto size....

Posted on 2002-04-08
4
366 Views
Last Modified: 2010-04-04
Hi guys

  I have a small problem abt the LV component. I have to change the column of a listview for different options. so i clear the columns and rewrite the columns at runtime, while doing this i set the autosize of the column to true.
but the first time it works perfect but on subsequent change of the options it dosent resize itself.

can anybody have a solution for this .....

Razal
0
Comment
Question by:razal_ka
4 Comments
 
LVL 45

Expert Comment

by:aikimark
ID: 6926579
how about Refreshing the component?
0
 

Author Comment

by:razal_ka
ID: 6930464
tried with vain .............but not use
0
 
LVL 6

Accepted Solution

by:
Stuart_Johnson earned 50 total points
ID: 6930475
This is a bodgey way of doing it, but it's the only way I've solved it:

ListView.Width := ListView.Width + 1;
ListView.Width := ListView.Width - 1;

This forces the autosize columns to resize.  Now, I'm sure there is a better way of doing it, but I haven't found it and I've been using this for ages.

Stu
0
 
LVL 1

Expert Comment

by:pnh73
ID: 9002997
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept answer from Stuart Johnson

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
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…

863 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

24 Experts available now in Live!

Get 1:1 Help Now