views:

281

answers:

2

hey all

In my tlistview all lines caption and subitem[0] filled with some data , and i want to fill other subitems line by line after all stored in caption and subitem .

Example

my listview is like this

user   pass   working status  valid 
data1  pass   ---               ---
data2  pass2 ----              -----
-
-
-

I loaded them success fully

now i got data for each acc like status and valid , how can i add them

when i tried all data storing in nextline like

user   pass   working status  valid 
data1  pass   ---               ---
data2  pass2 ----              -----
       yes   2009
       no

how can i fix this issue

thanks in advance

+3  A: 

How are you updating the existing items?

It should be something like:

ListView1.Items[0].SubItems[1] := 'Yes';
ListView1.Items[0].SubItems[2] := '2009';
ListView1.Items[1].SubItems[1] := 'No';
Difficult to understand the question but this answer is what I would have given if I understood correctly.
_J_
thanks for reply sir ,but when i tried i got this error :(exception class EstringlistErro with message Listindex out of bounds(4)how can i fix this sir ? thanks in advance
noob
problem fixed sir anyway thanks for support.
noob
what's with the "sir"?
Smasher
A: 

I'm not sure I understand the question either.

If you want the columns to be visible, you will need to add columns in the object inspector. (I guess you've already done this).

When you are adding listview items, your code will be something like;

MyItem:=ListView1.Items.Add;
MyItem.Caption:='data1';
for i:=0 to 2 do // this is number of desired subcolumns -1
  MyItem.SubItems.Add(''); // puts blank string in each cell

// then put your data in;
MyItem.SubItems[0]:='pass';
MyItem.SubItems[1]:='---';
MyItem.SubItems[2]:='--'
//etc
robsoft
thanks sir, I fixed issue , I didnt entered a blank string while loading to my listview . thanks alot sir
noob