I use the Toggle DesignMode design layout, and then
Var
Item: TListviewItem;
. .
Item:=listview1. Items. The Add;
Item. The Data [' Text1] :='clients:' + ClientModule1. ClientDataSet1. FieldByName (' KHMC2). AsString;
Item. The Data [' Text2] :="ID:" + ClientModule1. ClientDataSet1. FieldByName (' ID '.) AsString;
Data through the cycle after the data input to the Listview, late one record operation can't get the record ID value
Please click on a record, how to obtain Text2 ID value?
CodePudding user response:
Procedure TForm1. ListView1ItemClick (const Sender: TObject;Const AItem: TListViewItem);
The begin
Showmessage (ListView1. Items. AppearanceItem [ListView1 ItemIndex]. Data [' Text1] AsString) are identical.
end;