I have a TListView
on my form. I add some columns in it depending on the input like so:
MyItem := StringListView.Columns.Add;
MyItem.Caption := IntToStr(i);
MyItem.Width := -2;
Afterwards I use the onData
event to populate the ListView like this:
procedure TMatrixDictViewerFrame.StringListViewData(Sender: TObject;
Item: TListItem);
var
ItemCaption: string;
ItemText: string;`
begin
ItemCaption := Format('[%d]', [Item.Index]);
ItemText := FItems[Item.Index];
Item.Caption := ItemCaption;
Item.SubItems.Add(ItemText);
end;
It works fine since in the First column I have the Itemcaptions and in the second column I get the Itemtexts. What I couldnt figure out tho is how to populate the ListView depending on the data I get. For example: I have a matrix A which is a 3x3 Matrix and I want its elements to be shown in this ListView so the first row shows the first 3 row elements, the second row shows the second row three elements and so on. Questions: how can I access the third column? How can I populate the view according to the Index I have (i,j)?
Best regards