'Adding Items in ListView RAD Studio Delphi 10.2

I want to show a list with TListView, generated with data out of my database. But my code is only showing one item in the list.

It should look like a short List with Text like Adress, Name1, Name1 just like on this picture:

image

The Code for the view on the pic:

procedure TForm2.RefreshButton1Click(Sender: TObject); 
var
 queryListClient : TFDQuery;
 ItemAdd : TListViewItem;
begin
  queryListClient := TFDQuery.Create(Nil);
  queryListClient.Connection := FDConnection1;

  queryListClient.SQL.Clear;
  queryListClient.SQL.Add('Select * from Projekt ORDER by ProjNr');
  queryListClient.Open();
  queryListClient.First;

  List_Clients1.Items.Clear;
  List_Clients1.BeginUpdate;
  while Not queryListClient.Eof do
  begin
    ItemAdd := List_Clients1.Items.Add;
    ItemAdd.Text := queryListClient.FieldByName('Name1').AsString;
    ItemAdd.Detail := queryListClient.FieldByName('Name2').AsString;
    queryListClient.Next;
  end;
  List_Clients1.EndUpdate;
  queryListClient.Close;
  queryListClient.Free;
end;

What it looks like now:

What it looks like now



Solution 1:[1]

You probably did not link the listview SYNC property to your dataset (LiveBindings Designer).enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Fashion Strada