Board index » cppbuilder » Listview Subitem

Listview Subitem

I know how to get the selected item of a listview but i seem to be
running into some complications in getting a certain row of all items.
Can someone give me an example please.

I want to get all the values from SubItem[0]; without selecting any
of them directly (clicking on them).

Thanks

 

Re:Listview Subitem


TListItem *Item1;
for (int i=0; i < ListView1->Items->Count;i++) {

  Item1 = ListView1->Items->Item [i];
  ShowMessage (Item1->Caption);  // -- here is the caption  of the item

  ShowMessage (Item1->SubItems->Strings [0]);   // -- here is the first
subitem

//  or
  for (int j=0;j < Item1->SubItems->Count;j++) {
     ShowMessage (Item1->SubItems->Strings [j]);  // --here is all subitems
  }

Quote
}

Tamas Ronai
Quote
Jason wrote in message <39a1cda5$1_1@dnews>...
>I know how to get the selected item of a listview but i seem to be
>running into some complications in getting a certain row of all items.
>Can someone give me an example please.

>I want to get all the values from SubItem[0]; without selecting any
>of them directly (clicking on them).

>Thanks

Other Threads