chiwan
asked on
How to display sort triangle in column header of Tlistview
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
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
MyListView.Column[I].Image Index := constSortedColumnImage;
ASKER
I store the image in a imagelist, how
to get the image out from it and assign
it to mylistview.column[i].image index?
Thanks
Chiwan
to get the image out from it and assign
it to mylistview.column[i].image
Thanks
Chiwan
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.ListView1ColumnClic k(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
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.ListView1ColumnClic
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
ASKER
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
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
ASKER
Adjusted points to 200
ASKER
I tested, it seems not work, any comments?
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
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
ASKER
Yes, please kind send me a complete
demo, include your image to konchjin@statoil.com
Best Regards
Chiwan
demo, include your image to konchjin@statoil.com
Best Regards
Chiwan
have sent,sorry about large zip ,i wanted to include exe to show it working.
tell me how you get on.
chers Barry
tell me how you get on.
chers Barry
ASKER
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hello,
did it work?
the upgrade should have fixed this problem.
did it work?
the upgrade should have fixed this problem.
ASKER
Hi,
sorry for reply later, I installed
Delphi5, now have solved this problem.
Thanks & Rgds
Chiwan
sorry for reply later, I installed
Delphi5, now have solved this problem.
Thanks & Rgds
Chiwan