LazControls: Apply filter also at start in ListFilterEdit and ListviewFilterEdit. Issue #31632.

git-svn-id: trunk@54594 -
This commit is contained in:
juha 2017-04-09 17:25:22 +00:00
parent 0d8532961c
commit ef45c8ed44
2 changed files with 6 additions and 1 deletions

View File

@ -140,7 +140,9 @@ procedure TListFilterEdit.SetFilteredListbox(const AValue: TCustomListBox);
begin
if fFilteredListbox = AValue then Exit;
fFilteredListbox:=AValue;
if Assigned(fFilteredListbox) then begin
if Assigned(fFilteredListbox) then
begin
Filter:=Text;
fOriginalData.Assign(fFilteredListbox.Items);
if (fFilteredListbox is TCustomCheckListBox) and not Assigned(fCheckedItems) then
fCheckedItems:=TStringMap.Create(False);

View File

@ -156,8 +156,11 @@ begin
if fFilteredListview = AValue then Exit;
fFilteredListview:=AValue;
if Assigned(fFilteredListview) then
begin
Filter:=Text;
for i := 0 to fFilteredListview.Items.Count-1 do
fOriginalData.Add(ListItem2Data(fFilteredListview.Items[i]));
end;
end;
procedure TListViewFilterEdit.Notification(AComponent: TComponent; Operation: TOperation);