I have TFDMemTable data from API. The TFDMemTable is livebinded with TListView. The tricky part here is that, I want to show in the TListView the filtered data only using OnChangeTracking event of TEdit control.
Here's the code that I am working with to effect my intended result but, unfortunately, it is not returning anything.
procedure TformMain.edtSearchBoxChangeTracking(Sender: TObject);
var
metastr : string;
begin
metastr := edtSearchBox.text; //edtSearchBox is my TEdit control
with dmMain_u.dmMain do
begin
mtbMeta.Active := False; //mtbMeta is my TFDMemTable
mtbMeta.Filtered := False;
mtbMeta.Filter := 'meta LIKE ' + QuotedStr('%' + metastr + '%');
mtbMeta.Filtered := True;
mtbMeta.Active := True;
end;
end;
Can anyone here try to check my code if it is correct? Or I might need to do something else?