Кусок кода:
Код: Выделить всё
begin
ListView1.Items.BeginUpdate;
try
ListView1.Items.Clear;
ADOQuery1.SQL.Text := 'select * from sklad order by ID';
ADOQuery1.Open;
while not ADOQuery1.Eof do begin
with ListView1.Items.Add do begin
Data := Pointer(ADOQuery1.FieldByName('ID').AsInteger);
Caption := ADOQuery1.FieldByName('ART').AsString;
SubItems.Add(ADOQuery1.FieldByName('CAT').AsString);
SubItems.Add(ADOQuery1.FieldByName('NAME').AsString);
SubItems.Add(ADOQuery1.FieldByName('DATAV').AsString);
SubItems.Add(ADOQuery1.FieldByName('KOMY').AsString);
SubItems.Add(ADOQuery1.FieldByName('AVTO').AsString);
SubItems.Add(ADOQuery1.FieldByName('NOMER').AsString);
SubItems.Add(ADOQuery1.FieldByName('KOLVO').AsString);
SubItems.Add(ADOQuery1.FieldByName('DOP').AsString);
end;
ADOQuery1.Next;
end;
finally
ListView1.Items.EndUpdate;
end;
ListView1.Width:=1201;
ListView1.Height:=593;
ListView1.Left:=224;
ListView1.Top:=40;
ListView1.Visible:=TRUE;
CloseListview.Enabled:=TRUE;
end;