function SizeCustomSort(Item1, Item2: TListItem; ParamSort: integer): integer;

stdcall;

var

R1, R2: real;

code: Integer;

begin

val(Item1.SubItems.Strings

val(Item2.SubItems.Strings

if R1 > R2 then

result := ParamSort

else if R1 < R2 then

result := -ParamSort

else

result := 0;

end;

procedure TForm1.ListView1ColumnClic

begin

if Column.Index = 1 then

begin

ListView1.CustomSort(@Size

SizeSortOrder := SizeSortOrder * -1; {reverse the next sort order}

end

else

begin

ListView1.SortType := stText;

ListView1.AlphaSort;

end;

end;