Title: Message
Yeah, there does need to be a ReverseSort := not ReverseSort there also as Kurt may have suggested.
 
Ross.
----- Original Message -----
Sent: Saturday, October 18, 2003 4:54 PM
Subject: RE: [DUG]: Listview Sort

oh thank GOD (or Ross ;-) ) for that !! theres lot of data in the list view and I was getting worried !
 
Thanks Ross....p.s. I could tell by looking at the code it was not quire tight, but thats ok, as I was able to use what code I had already done.
 
Right....now to finish the damn project off !!!
 
Jeremy
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ross Levis
Sent: Saturday, 18 October 2003 17:04
To: Multiple recipients of list delphi
Subject: Re: [DUG]: Listview Sort

> Yip got that far, but how do I trigger it to go off and do a sort again
> when I click on the header? That's where I am stuck now.
procedure TListViewForm.FileViewColumnClick(Sender: TObject; Column: TListColumn);
  function CustomSortProc(Item1, Item2: TListItem; OptionalParam: integer): integer; stdcall;
  begin
    Result := StrToInt(Item1.SubItems[0]) > StrToInt(Item2.SubItems[0])
    if ReverseSort then Result := -Result;
  end;
  ListView.CustomSort(@CustomSortProc, OptionalParam);
end;
 
> do I have to repopulate the listview
 
No.
 
Regards,
Ross Levis.

Reply via email to