Delphi Xe2. Listview (Lv1) with the big list items. Lv1 have standart compare procedure “TForm1.lv1Compare”. Sorting is started by standard procedure lv1.AlphaSort; All works and is sorted normally. A question: how immediately to stop the started sorting in case of need?
example:
procedure tform1.button1.onclick(..);
begin
lv1.AlphaSort; // start sorting
end;
procedure tform1.button2.onclick(..);
begin
//lv1.StopSort; // stop sorting ???
end;
Or can be in procedure OnCompare there is any command of a stop?
Inside of the
TListView.AlphaSorttheListView_SortItemsmacro is being called but I can’t see any mention about how to stop the sorting process in the reference (even through the callback function), so I’m afraid this is not possible (at least regular way).Like Sertac suggested in his comment, as one possible workaround might be to raise the silent exception inside of the OnCompare event: