I want to add some strings to a ListView, but I dont know how long the string can be.
For example:
mystring := 'a'+|+'b'+|+ 'c'+|+ 'd'+|+ 'e'+|+ 'f'+|+ ....... '1000 of mystr';
After I explode the string, I have:
'a'
'b'
'c'
.
.
.
'1000ofmystr'
I want to add a new item to the ListView where 'A' is the Caption and 'B' and 'C' are SubItems.
Then add a new item where 'D' is the Caption and 'E' and 'F' are SubItems.
And then continue like this for the entire string, even when it has millions of substrings in the exploded data.
Every three substrings is one ListView item, until the string is exhausted.
I don't know how to do this, that's why I am asking here. What I want to do is like this picture:
I need something like this code:
ListView1.Items.Add;
ListView1.Caption:= StrArr[0]; // id of the book number one
SubItems.Add(StrArr[1]); //its title
SubItems.Add(StrArr[2]); // its editor
ListView1.Items.Add;
ListView1.Caption:= StrArr[3]; // id of the book number two
SubItems.Add(StrArr[4]); //its title
SubItems.Add(StrArr[5]); // its editor
ListView1.Items.Add;
ListView1.Caption:= StrArr[6]; // id of the book number three
// and so on for other books for an unknown number of strings
Please show me the correct code to do this.