Is it possible to filter an TAdapterBindSource ?

Is it possible to filter an TAdapterBindSource ?

My adapter is bound to an TObjectList and i want to filter my listview content.
I haven't found any TAdapterBindSource.filter / setfiler ...

I've changed my TObjectList to a TFilteredList (see Malcom Groves blogs), refreshed my list this way :

with TListBindSourceAdapter(adpTaches.InternalAdapter) do
begin
TCRMData.GetInstance.taches.SetFilter(
function(Item: TCRMTache): Boolean
begin
Result := not Item.Termine;
end); // display only finished tasks
SetList(TCRMData.GetInstance.taches, False);
Active := true;
end;

but all data is still displayed ! The only solution seems to go with a temporary TObjectList holding non finished object only.... but this isn't really nice.


Does anyone have a better solution ?

Comments