Search code examples
delphifiremonkeydelphi-xe8

Clear Firemonkey TListView search text


ListView1.items.filter := nil;

I understand that the above will clear the filter of a listview however if the Search is visible for the listview and something is typed into it, is there anyway of clearing the text from it?


Solution

  • for I := 0 to ListView1.Controls.Count-1 do
      if ListView1.Controls[I] is TSearchBox then
      begin
        TSearchBox(ListView1.Controls[I]).Text := '';
      end;
    

    (based on DocWiki!)