Set SortType to 'stBoth' and implement the OnCompare event OnCompare . Example:
procedure TForm1.ListView1Compare(Sender: TObject; Item1, Item2: TListItem; Data: Integer; var Compare: Integer); var S1, S2: string; begin S1 := Item1.Caption; if Item1.SubItems.Count > 0 then S1 := S1 + Item1.SubItems[0]; S2 := Item2.Caption; if Item2.SubItems.Count > 0 then S2 := S2 + Item2.SubItems[0]; Compare := CompareText(S1, S2); end;
source share