robertjohns 0 Posted September 24, 2022 I need to add Listview items from 2 Memo's , I am using Delphi 10.2 Tokyo Memo1 lines are as line1 line2 line3 line4 line5 Memo2 lines are as something1 something2 something3 something4 something5 Need to add these 2 Memo lines into Listview Listview Caption = Memo1 lines Listview SubItem = Memo2 lines Need help to achieve this Thanks in advance Share this post Link to post
Pat Foley 51 Posted September 24, 2022 33 minutes ago, robertjohns said: Need to add these 2 Memo lines into Listview Listview Caption = Memo1 lines Listview SubItem = Memo2 lines Be sure View is report Here's 11.1 vintage clues on a project I am working on Allistair has a video on strUtils that showed similar stuff. procedure TForm3.Button3Click(Sender: TObject); var tvCol: TListColumn; Vi: TListView; li: TListItem; begin var SL := TStringList.Create; var ctL := TStringList.Create; SL.LoadFromFile('Logger11.csv'); LV.Clear; for var R := 0 to SL.Count - 1 do begin ctL.CommaText := SL.Strings[R]; if R = 0 then for var K := 0 to ctL.Count - 1 do begin tvCol := LV.Columns.add; tvCol.Caption := ctL[K]; tvCol.Width := 120; end else begin li := LV.items.add; li.Caption := ctL[0]; ctL.Delete(0); li.SubItems.CommaText := (ctL.CommaText); end; end; SL.Free; ctL.Free; end; Share this post Link to post
robertjohns 0 Posted September 24, 2022 (edited) 25 minutes ago, Pat Foley said: Be sure View is report Here's 11.1 vintage clues on a project I am working on Allistair has a video on strUtils that showed similar stuff. procedure TForm3.Button3Click(Sender: TObject); var tvCol: TListColumn; Vi: TListView; li: TListItem; begin var SL := TStringList.Create; var ctL := TStringList.Create; SL.LoadFromFile('Logger11.csv'); LV.Clear; for var R := 0 to SL.Count - 1 do begin ctL.CommaText := SL.Strings[R]; if R = 0 then for var K := 0 to ctL.Count - 1 do begin tvCol := LV.Columns.add; tvCol.Caption := ctL[K]; tvCol.Width := 120; end else begin li := LV.items.add; li.Caption := ctL[0]; ctL.Delete(0); li.SubItems.CommaText := (ctL.CommaText); end; end; SL.Free; ctL.Free; end; Thanks for reply Need to add these 2 Memo lines into Listview Listview Caption = Memo1 lines Listview SubItem = Memo2 lines SL.LoadFromFile('Logger11.csv'); but the I am seeking help about using Memo1 lines as Listview Caption and Memo2 lines as Listview subitem Edited September 24, 2022 by robertjohns Share this post Link to post
Pat Foley 51 Posted September 24, 2022 The clues did not include that Memo1.Lines equates to crL: StringList using ctL[0] for caption. The ctL.commatext is used for the subitems. again viewstyle is vsReport set with F11 object injector. Share this post Link to post
robertjohns 0 Posted September 25, 2022 7 hours ago, Pat Foley said: The clues did not include that Memo1.Lines equates to crL: StringList using ctL[0] for caption. The ctL.commatext is used for the subitems. again viewstyle is vsReport set with F11 object injector. Thanks again for your reply . loading from file it is easy but I need it from 2 memo lines and it seems harder to achieve it especially for me May some will come out with solution and help me here Share this post Link to post
robertjohns 0 Posted September 25, 2022 (edited) Thanks a lot problem solved Edited September 25, 2022 by robertjohns Share this post Link to post