Solved

List view column auto size....

Posted on 2002-04-08
4
369 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…

733 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