Solved

How to display sort triangle in column header of Tlistview

Posted on 2000-03-04
13
487 Views
Last Modified: 2010-04-04
I am writing a report use Tlistview,
how to display sort triangle in column header of Tlistview? (like Microsoft outlook) when user click column header,
it up or down according sort type.

Thanks & Rgds

Chiwan
0
Comment
Question by:chiwan
[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
  • 7
  • 5
13 Comments
 
LVL 1

Expert Comment

by:XAN
ID: 2582925
MyListView.Column[I].ImageIndex := constSortedColumnImage;
0
 

Author Comment

by:chiwan
ID: 2583050
I store the image in a imagelist, how
to get the image out from it and assign
it to mylistview.column[i].imageindex?

Thanks

Chiwan
0
 
LVL 17

Expert Comment

by:inthe
ID: 2583778
chiwan ,
just assign the imagelist to your listview as normal
(or do it on form create event like below)

procedure TForm1.FormCreate(Sender: TObject);
begin
//my imagelist contains 5 images
Listview1.SmallImages := imagelist1;
end;

procedure TForm1.ListView1ColumnClick(Sender: TObject;
  Column: TListColumn);
begin
//check we have correct column
if (column.DisplayName = 'column2')then
 begin
//assign imageindex to image number in imagelist
  Column.ImageIndex := 3;
//  do some sort procedure...
 end;
end;

hope that makes sense ;-)
Regards Barry
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:chiwan
ID: 2584268
Hi, Barry
Are you sure column.imageindex using the
image stored in listview.smallimages?
I tried your method, it seems not work,
are there any special requirement for
the image type stored in imagelist?
(I am using standard bmp file).

Rgds

Chiwan
0
 

Author Comment

by:chiwan
ID: 2584728
Adjusted points to 200
0
 

Author Comment

by:chiwan
ID: 2584729
I tested, it seems not work, any comments?
0
 
LVL 17

Expert Comment

by:inthe
ID: 2585095
er well it work fine for me..maybe i send you a demo ..
if you want leave your email address.
how big is your image?
i know send me your image and i try using it(if you dont mind)and i send back the demo .

legend@enterprise.net

Regards Barry

0
 

Author Comment

by:chiwan
ID: 2585887
Yes, please kind send me a complete
demo, include your image to konchjin@statoil.com

Best Regards

Chiwan
0
 
LVL 17

Expert Comment

by:inthe
ID: 2586034
have sent,sorry about large zip ,i wanted to include exe to show it working.
tell me how you get on.
chers Barry
0
 

Author Comment

by:chiwan
ID: 2586435
Thank you, I have received and test it,
the strange thing is I can run you exe file no problem, but If I compile your
project fiel, still no sort triangle :((

I am just wonder whether any dll file I need to upgrade? I am using Windows95 and Delphi4.

Thanks & Rgds

Chiwan
0
 
LVL 17

Accepted Solution

by:
inthe earned 200 total points
ID: 2587297
oh ,it is most likely you need to upgrade commctrl.dll.

you can get update patch which installs newer dll here:

http://www.microsoft.com/msdownload/ieplatform/ie/comctrlx86.asp


direct link to file:

http://download.microsoft.com/download/platformsdk/Comctl32/5.80.2614.3600/W9XNT4/EN-US/50comupd.exe

Regrads Barry
0
 
LVL 17

Expert Comment

by:inthe
ID: 2675448
hello,

did it work?
the upgrade should have fixed this problem.
0
 

Author Comment

by:chiwan
ID: 2675733
Hi,
sorry for reply later, I installed
Delphi5, now have solved this problem.

Thanks & Rgds

Chiwan
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

695 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