Solved

List view column auto size....

Posted on 2002-04-08
4
365 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
Comment Utility
how about Refreshing the component?
0
 

Author Comment

by:razal_ka
Comment Utility
tried with vain .............but not use
0
 
LVL 6

Accepted Solution

by:
Stuart_Johnson earned 50 total points
Comment Utility
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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Create a Restore Point In Windows 10 3 102
System restore point 4 77
Thread safe  opinion 7 109
delphi parse string to params 3 81
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…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 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

11 Experts available now in Live!

Get 1:1 Help Now