0

I need to set search string in Delphi FM.Android TListView. This box is showing when I set ListView.SearchVisible = true. But there is no such property like 'SerchString'. How can I reed it or set it in code? Is It possible? if not, may be it is some other way to make filtering ListView?

user2880885
  • 93
  • 2
  • 11

2 Answers2

0

If I understood your question,

It is automatically work, just add some items on the listbox and try the searchbox it will work on the itemtext of the items and show only the items of the filter string you entered on the searchbox.

wahm sarab
  • 89
  • 5
0
function FindSearchBox(const ARootControl: TControl): TSearchBox;
var
  Child: TControl;
begin
  Result := nil;
  for Child in ARootControl.Controls do
    if Child is TSearchBox then
      Exit(TSearchBox(Child));
end;


procedure TFormAdd.SpeedButton1Click(Sender: TObject);
var
  SearchBox: TSearchBox;
begin
  SearchBox:=FindSearchBox(FormMain.ListView1);
  if SearchBox <> nil then
  begin
    SearchBox.Text:=''; // set text here
  end;
end;
Rusland
  • 159
  • 2
  • 13