Delphi 11.3 and latest TMS VCL UI pack as of today.
I am using the TADVEdit.Lookup feature which everyone is liking A lot.
The only problem is sorting.
procedure TCustomAdvEdit.UpdateLookup;
This does
FLookupListBox.Sorted := True;
We have A list that is sorta sorted... we have some items that the users always want at the bottom of the list shown.
It would be nice to have this NOT sort and possibly call a custom sort event or something before showing the list? Anything that would allow me to define what the order of items are?
I do have a hacky hack that is hacky.
Insert $e0078 unicode infront of the list of items i want at the bottom.
And this pushes them to bottom on the sort.
"works" but figure it would be nice to have something offical.
Another thing I have been fighting was TopIndex.. Sometimes the listbox isn't scrolled to the exact matched item.
So I do something like this.. is this a bug and why i need to do this or feature option I am not seeing?
procedure TfrmFind.editLookupNeedData(Sender: TObject; Value: string; List: TStrings; var ItemIndex: Integer);
var
idx: Integer;
begin
idx := List.IndexOf(Value);
if idx > -1 then
begin
ItemIndex := idx;
// scroll item into view
// adds to message loop
// ForceQueue, so control can do its thing first
tthread.ForceQueue(nil,
procedure
begin
(Sender as TADVEdit).LookupList.ListControl.TopIndex := idx;
end);
end;
end;